nodeupdown(3) - Linux man page

Name

Nodeupdown - Perl API for determining up and down nodes

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

Nodeupdown->new([$host, [$port]])
Creates and returns a Nodeupdown object. If the host, port, or timeoutlen, are not specified, default values are assumed. On error, undef is returned.
$obj->up_nodes()
Return 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.
$obj->down_nodes()
Return 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.
$obj->are_up(@nodes)
Returns 1 is all the nodes passed in are determined as up. Returns 0 if any node passed is not up.
$obj->are_down(@nodes)
Returns 1 is 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.
$obj->down_count()
Returns the number of down nodes.

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. For example, if an improper node name is used (e.g. $obj->are_up("foobar"), $obj->are_down("foobar")), both are_up() and are_down() will fail.

Author

Albert Chu <chu11@llnl.gov>

See Also

libnodeupdown.

whatsup.

Referenced By

whatsup(1)