LIBNODEUPDOWN(3)

πŸ“¦
version 1.14 Β· 2 versions
, in epel 9, fedora 43, fedora 44

πŸ’– LIBNODEUPDOWN πŸ’–

okay so bestie, welcome to libnodeupdown(3) β€” it's a whole library of functions whose entire job is figuring out if a node is up or down. yes, that's it. that's the vibe. cluster gossip, but make it C. ✨


✨ SYNOPSIS ✨

#include <nodeupdown.h>

nodeupdown_t nodeupdown_handle_create(void);

int nodeupdown_handle_destroy(nodeupdown_t handle);

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

int nodeupdown_errnum(nodeupdown_t handle);

char *nodeupdown_strerror(int errnum);

char *nodeupdown_errormsg(int errnum);

void nodeupdown_perror(nodeupdown_t handle, const char *msg);

int nodeupdown_get_up_nodes_string(nodeupdown_t handle, char *buf, int buflen);

int nodeupdown_get_down_nodes_string(nodeupdown_t handle, char *buf, int buflen);

int nodeupdown_get_up_nodes_list(nodeupdown_t handle, char **list, int len);

int nodeupdown_get_down_nodes_list(nodeupdown_t handle, char **list, int len);

int nodeupdown_is_node_up(nodeupdown_t handle, const char *node);

int nodeupdown_is_node_down(nodeupdown_t handle, const char *node);

int nodeupdown_up_count(nodeupdown_t handle);

int nodeupdown_down_count(nodeupdown_t handle);

int nodeupdown_last_up_time(nodeupdown_t handle, const char *node, unsigned int *last_up_time);

int nodeupdown_nodelist_create(nodeupdown_t handle, char ***list);

int nodeupdown_nodelist_clear(nodeupdown_t handle, char **list);

int nodeupdown_nodelist_destroy(nodeupdown_t handle, char **list);

like, all of them. no crumbs. πŸ’…


🌸 DESCRIPTION 🌸

so the nodeupdown library functions are a lil set of functions that talk to a particular backend tool and a clusterlist database to figure out whether the nodes of a cluster are up or down. that's the whole plot. 🫢

scroll down bestie for the extra tea on backend modules and clusterlist modules β€” that's where you learn which backend tool and which clusterlist database format actually gets used.

for API deets, go read the individual manpages for each of the functions listed up there ↑, or honestly just read the comments written in /usr/include/nodeupdown.h β€” they're right there. and if you want the configuration file lore, that's nodeupdown.conf(5). πŸ‘‘


πŸ”₯ BACKEND MODULES πŸ”₯

the nodeupdown library loads a backend module, which uses a particular backend tool, to gather up/down info for the library. by default, nodeupdown searches for these backend tools in this exact order:

and if literally none of the above are found? the library keeps hunting for a backend module in /usr/lib64/nodeupdown until one turns up. she's persistent. πŸ’€


πŸ¦‹ CLUSTERLIST MODULES πŸ¦‹

the nodeupdown library also loads a clusterlist module to get a list of all the cluster nodes. there are several possible clusterlist formats it can parse. by default, nodeupdown searches for these clusterlist modules in this order:

  • genders β€” uses a genders database and the genders library to determine all nodes in the cluster. see http://genders.sourceforge.net.
  • hostsfile β€” uses a file that lists the hostname of every node in the cluster, one per line, each on a separate line. the default hostsfile is /etc/hostsfile.

if none of the above are found, the library goes looking for a clusterlist module in /usr/lib64/nodeupdown. and if those aren't found either? the nodeupdown library just implements a default behavior itself. she improvises. ✨


πŸŽ€ CONFIG MODULES πŸŽ€

the nodeupdown library optionally loads a configuration module, which can define the default values used in nodeupdown_load_data(3). why? because the config module is primarily there for ease of configuring a large cluster of nodes β€” way better than writing and distributing multiple configuration files all over the cluster like some kind of gremlin. πŸ™ˆ

by default, nodeupdown searches for these configuration modules in this order:

  • None built by default

if none of the above are found, the library searches for a config module in /usr/lib64/nodeupdown. also important, bestie: the nodeupdown configuration file takes precedence over the configuration module. and when neither one is in use, the defaults are supplied by the backend tool. periodt. πŸ‘‘


πŸ“ FILES πŸ“

  • /usr/include/nodeupdown.h

🌈 SEE ALSO 🌈


okay that's the whole page, you ate that πŸ’… and before you go β€” this icon was brought to you by LLNL, dated August 2003, and it's living in the LIBNODEUPDOWN(3) era of the manual. go check your nodes, bestie. πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from