Nodeupdown(3)

πŸ“¦
version 1.14 Β· 3 versions
, in epel 9

πŸŽ€ Nodeupdown(3) πŸŽ€

okay so this is the User Contributed Perl Documentation page for Nodeupdown, aka the Perl API for figuring out which nodes are up and which are down. bestie, it’s giving cluster-vibes and we’re obsessed. πŸ’–


✨ NAME ✨

Nodeupdown β€” Perl API for determining up and down nodes. that’s the whole assignment, no cap. πŸ’…


🌈 SYNOPSIS 🌈

use Nodeupdown;

$obj = Nodeupdown->new([$host, [$port [$timeoutlen]]])

$upnodes = $obj->up_nodes()
@uplist  = $obj->up_nodes()

$downnodes = $obj->down_nodes()
@downlist  = $obj->down_nodes()

$bool = $obj->are_up(@nodes)
$bool = $obj->are_down(@nodes)

$num = $obj->up_count()
$num = $obj->down_count()

πŸ’– DESCRIPTION πŸ’–

This package provides a Perl API for determining up and down nodes. literally the main character of this module. ✨

  • Nodeupdown->new([$host, [$port]]) β€” creates and returns a Nodeupdown object. If host, port, or timeoutlen are not specified, default values are assumed. On error, undef is returned. 🫢
  • $obj->up_nodes() β€” returns the up nodes in a cluster. If the context in which the subroutine is invoked is looking for a scalar, a hostlist formatted string of up nodes will be returned. If the context in which the subroutine is invoked is looking for a list, a list containing each up node will be returned. scalar context vs. list context, iykyk. πŸ’«
  • $obj->down_nodes() β€” returns the down nodes in a cluster. If the context in which the subroutine is invoked is looking for a scalar, a hostlist formatted string of down nodes will be returned. If the context in which the subroutine is invoked is looking for a list, a list containing each down node will be returned. same energy, opposite direction. 🌸
  • $obj->are_up(@nodes) β€” returns 1 if all the nodes passed in are determined as up. Returns 0 if any node passed is not up. πŸ‘‘
  • $obj->are_down(@nodes) β€” returns 1 if all the nodes passed in are determined as down. Returns 0 if any node passed is not down. πŸ’…
  • $obj->up_count() β€” returns the number of up nodes. simple math, slay. πŸ”₯
  • $obj->down_count() β€” returns the number of down nodes. also simple math, also slay. πŸ”₯

πŸ’€ BUGS πŸ’€

Please be careful with the semantics of are_up() and are_down(). Just because a node is not up, does not mean it is down. this is the plot twist, bestie. 😭

For example, if an improper node name is used β€” like $obj->are_up("foobar"), $obj->are_down("foobar") β€” both are_up() and are_down() will fail. not me finding out the hard way. πŸ’€

fr fr: β€œnot up” β‰  β€œdown”. keep that in your notes. 🫢

πŸ‘‘ AUTHOR πŸ‘‘

Albert Chu <chu11@llnl.gov> β€” icon behavior. πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

  • libnodeupdown.
  • whatsup.

go check those out, iykyk. 🌈


mwah πŸ’‹ β€” this page is from perl v5.32.1, dated 2023-01-21. πŸŽ€

πŸ“¦ where this page comes from