nodeupdown_load_data - Man Page

load data

Synopsis

#include <nodeupdown.h>

int nodeupdown_load_data(nodeupdown_t handle, const char *hostname, int port, int timeout_len, char *module);

Description

nodeupdown_load_data() loads data from the nodeupdown backend tool's server so that the remaining nodeupdown library functions can properly return information about up and down nodes.

handle is a nodeupdown handle created by nodeupdown_handle_create(3).

hostname should indicate the location of the server.  If hostname is NULL, nodeupdown assumes the backend tool's default server.

port should indicate the port number of the server.  If port less than or equal to 0, nodeupdown assumes the server is running on the backend tool's default port.

timeout_len should indicate the timeout length in seconds that determines if a node is up or down.  If timeout_len is less than or equal to 0, nodeupdown assumes the backend tool's default timeout.
 module may be used to specify a specific backend module for up-down calculations.  If module is NULL, nodeupdown will search for the appropriate module itself.

The default values used in nodeupdown_load_data() can be overwritten if a nodeupdown configuration module is found or if the nodeupdown configuration file is used.  See libnodeupdown(3) and nodeupdown.conf(5) for information.  The nodeupdown configuration file has precedence over the configuration module.

Return Values

On success, 0 is returned.  On error, -1 is returned, and an error code is returned in handle.  The error code can be retrieved via nodeupdown_errnum(3) , and a description of the error code can be retrieved via nodeupdown_strerror(3). Error codes are defined in nodeupdown.h.

Errors

NODEUPDOWN_ERR_NULLHANDLE

The handle parameter is NULL.  The nodeupdown handle must be created with nodeupdown_handle_create(3).

NODEUPDOWN_ERR_OPEN

A clusterlist database could not be opened.

NODEUPDOWN_ERR_CONNECT

Error connecting to server specified by hostname and gmond_port.

NODEUPDOWN_ERR_CONNECT_TIMEOUT

Connection to server timed out.

NODEUPDOWN_ERR_HOSTNAME

Incorrect hostname specified by hostname.

NODEUPDOWN_ERR_ISLOADED

nodeupdown_load_data(3) has already been called with handle.  

NODEUPDOWN_ERR_PARAMETERS

An incorrect parameter has been passed in.

NODEUPDOWN_ERR_OUTMEM

malloc(3) has failed internally.

NODEUPDOWN_ERR_BACKEND_MODULE

Internal error with the backend module

NODEUPDOWN_ERR_CLUSTERLIST_MODULE

Internal error with the clusterlist module

NODEUPDOWN_ERR_CONFIG_MODULE

Internal error with the config module

NODEUPDOWN_ERR_CONF_PARSE

Error parsing the nodeupdown conf file.

NODEUPDOWN_ERR_CONF_INPUT

Error with input in the nodeupdown conf file.

NODEUPDOWN_ERR_CONF_INTERNAL

Internal error with the nodeupdown configuration file.

NODEUPDOWN_ERR_MAGIC

handle has an incorrect magic number.  handle does not point to a nodeupdown handle or handle has been destroyed by nodeupdown_handle_destroy(3).

NODEUPDOWN_ERR_INTERNAL

An internal system error has occurred.  

Files

/usr/include/nodeupdown.h

See Also

libnodeupdown(3), nodeupdown_handle_create(3), nodeupdown_handle_destroy(3), nodeupdown_errnum(3), nodeupdown_strerror(3), nodeupdown.conf(5)

Referenced By

libnodeupdown(3), nodeupdown.conf(5), nodeupdown_get_up_nodes_list(3), nodeupdown_get_up_nodes_string(3), nodeupdown_handle_create(3), nodeupdown_handle_destroy(3), nodeupdown_is_node_up(3), nodeupdown_last_up_time(3), nodeupdown_module(3), nodeupdown_nodelist_create(3), nodeupdown_up_count(3).

November 2003 LLNL LIBNODEUPDOWN