Libnodeupdown(3) User Contributed Perl Documentation Libnodeupdown(3)NAMELibnodeupdown - Perl extension for libnodeupdown
SYNOPSIS
use Libnodeupdown;
Libnodeupdown::NODEUPDOWN_ERR_SUCCESS
Libnodeupdown::NODEUPDOWN_ERR_NULLHANDLE
Libnodeupdown::NODEUPDOWN_ERR_CONNECT
Libnodeupdown::NODEUPDOWN_ERR_CONNECT_TIMEOUT
Libnodeupdown::NODEUPDOWN_ERR_HOSTNAME
Libnodeupdown::NODEUPDOWN_ERR_ISLOADED
Libnodeupdown::NODEUPDOWN_ERR_NOTLOADED
Libnodeupdown::NODEUPDOWN_ERR_OVERFLOW
Libnodeupdown::NODEUPDOWN_ERR_PARAMETERS
Libnodeupdown::NODEUPDOWN_ERR_NULLPTR
Libnodeupdown::NODEUPDOWN_ERR_OUTMEM
Libnodeupdown::NODEUPDOWN_ERR_NOTFOUND
Libnodeupdown::NODEUPDOWN_ERR_BACKEND_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CLUSTERLIST_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONFIG_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONF_PARSE
Libnodeupdown::NODEUPDOWN_ERR_CONF_INPUT
Libnodeupdown::NODEUPDOWN_ERR_CONF_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_MAGIC
Libnodeupdown::NODEUPDOWN_ERR_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_ERRNUMRANGE
$handle = Libnodeupdown->nodeupdown_handle_create();
$handle->nodeupdown_load_data();
$handle->nodeupdown_load_data($hostname,
$port,
$timeout_len,
$reserved);
$handle->nodeupdown_errnum()
$handle->nodeupdown_strerror($errnum)
$handle->nodeupdown_errormsg()
$handle->nodeupdown_perror($msg)
$handle->nodeupdown_get_up_nodes_string();
$handle->nodeupdown_get_down_nodes_string();
$handle->nodeupdown_get_up_nodes_list();
$handle->nodeupdown_get_down_nodes_list();
$handle->nodeupdown_is_node_up($node);
$handle->nodeupdown_is_node_down($node);
$handle->nodeupdown_up_count();
$handle->nodeupdown_down_count();
DESCRIPTION
This package provides an OO perl interface to the nodeupdown C API (see
libnodeupdown(3)). The perl interface is simliar to the nodeupdown C
API, with some necessary changes due to the inherent differences
between C and perl. Please read the instructions below so to
understand how to use the Libnodeupdown package.
Initialization
Libnodeupdown->nodeupdown_handle_create
Returns a nodeupdown object on success, undef on error.
$handle->nodeupdown_load_data()
$handle->nodeupdown_load_data($hostname, $port, $timeout_len,
$reserved)
Loads data for the remainder of the nodeupdown library to use. To
use default values, pass in undef for any of the specified
parameters. To use all defaults, simply call nodeupdown_load_data
without any parameters. Returns 0 on success, -1 on error.
Error Messages
Similarly to the C API, an error code is stored in the nodeupdown
object after an error has occurred. The following can be used to
retrieve the error code and output information about the error.
$handle->nodeupdown_errnum()
Returns the error code most recently set.
$handle->nodeupdown_strerror($errnum)
Returns a string describing the error code $errnum.
$handle->nodeupdown_errormsg()
Returns a string describing the most recent error.
$handle->nodeupdown_perror([$msg])
Outputs $msg and a string describing the most recent error to
standard error. If $msg is not specified, only a description of
the most recent error will be output to standard error.
Data Functions
$handle->nodeupdown_get_up_nodes_string()
Returns a ranged string of nodes that are up. Returns undef on
error.
$handle->nodeupdown_get_down_nodes_string()
Returns a ranged string of nodes that are down. Returns undef on
error.
$handle->nodeupdown_get_up_nodes_list()
Returns a list of nodes that are up. Returns undef on error.
$handle->nodeupdown_get_down_nodes_list()
Returns a list of nodes that are up. Returns undef on error.
$handle->nodeupdown_is_node_up($node)
Returns 1 if the specified node is up, 0 if not, -1 on error.
$handle->nodeupdown_is_node_down($node)
Returns 1 if the specified node is down, 0 if not, -1 on error.
$handle->nodeupdown_up_count()
Returns the number of up nodes, -1 on error.
$handle->nodeupdown_down_count()
Returns the number of down nodes, -1 on error.
Error Codes/Constants
The same error codes and constants listed in /usr/include/nodeupdown.h
can be accessed through the following functions:
Libnodeupdown::NODEUPDOWN_ERR_SUCCESS
Libnodeupdown::NODEUPDOWN_ERR_NULLHANDLE
Libnodeupdown::NODEUPDOWN_ERR_CONNECT
Libnodeupdown::NODEUPDOWN_ERR_CONNECT_TIMEOUT
Libnodeupdown::NODEUPDOWN_ERR_HOSTNAME
Libnodeupdown::NODEUPDOWN_ERR_ISLOADED
Libnodeupdown::NODEUPDOWN_ERR_NOTLOADED
Libnodeupdown::NODEUPDOWN_ERR_OVERFLOW
Libnodeupdown::NODEUPDOWN_ERR_PARAMETERS
Libnodeupdown::NODEUPDOWN_ERR_NULLPTR
Libnodeupdown::NODEUPDOWN_ERR_OUTMEM
Libnodeupdown::NODEUPDOWN_ERR_NOTFOUND
Libnodeupdown::NODEUPDOWN_ERR_BACKEND_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CLUSTERLIST_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONFIG_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONF_PARSE
Libnodeupdown::NODEUPDOWN_ERR_CONF_INPUT
Libnodeupdown::NODEUPDOWN_ERR_CONF_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_MAGIC
Libnodeupdown::NODEUPDOWN_ERR_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_ERRNUMRANGE
AUTHOR
Albert Chu <chu11@llnl.gov>
SEE ALSO
libnodeupdown
perl v5.14.2 2012-07-30 Libnodeupdown(3)