LIBNODEUPDOWN(3)

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

✨ NAME ✨

ok so bestie, listen β€” libnodeupdown is literally just a library of functions that tell you whether a node is up or down. that's it. that's the whole vibe. πŸ’–


🌸 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);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the nodeupdown library functions are a whole little squad of functions that team up with a particular backend tool and a clusterlist database to figure out if the nodes in a cluster are up or down. no cap. πŸ’…

and like, if you wanna know which backend tool and which clusterlist database format is getting used β€” keep scrolling bestie, there's whole sections below for that. πŸ‘‡

for actual API deets, go read the individual manpages for each of the functions up there ⬆️, or honestly just read the comments written in /usr/include/nodeupdown.h. and for the tea on the nodeupdown config file, check the nodeupdown.conf(5) manpage. 🫢


πŸ”₯ 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 those are found? the nodeupdown library keeps searching for a backend module in /usr/lib/nodeupdown until one turns up. determined queen behavior honestly. πŸ‘‘


🌈 CLUSTERLIST MODULES 🌈

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

  • genders β€” uses a genders database and the genders library to determine all the 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. the default hostsfile is /etc/hostsfile.

if none of those are found, the nodeupdown library searches for a clusterlist module in /usr/lib/nodeupdown. and if still nothing turns up? a default behavior gets implemented by the nodeupdown library. it said fine, i'll do it myself. πŸ’€


πŸŽ€ CONFIG MODULES πŸŽ€

the nodeupdown library optionally loads a configuration module, which can be used to define the default values used in nodeupdown_load_data(3). this is mainly for the girlies managing a huge cluster of nodes, so you don't have to write and distribute a million configuration files all over the cluster. it's giving convenience, fr fr.

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

  • None built by default

if none of the above are found, the nodeupdown library searches for a config module in /usr/lib/nodeupdown. and heads up ⚠️ β€” the nodeupdown configuration file takes precedence over the configuration module. when neither one is in use, the defaults are supplied by the backend tool. periodt.


πŸ’œ FILES πŸ’œ

  • /usr/include/nodeupdown.h

🌟 SEE ALSO 🌟

nodeupdown_handle_create(3), nodeupdown_load_data(3), nodeupdown_handle_destroy(3), nodeupdown_errnum(3), nodeupdown_strerror(3), nodeupdown_errormsg(3), nodeupdown_perror(3), nodeupdown_get_up_nodes_string(3), nodeupdown_get_down_nodes_string(3), nodeupdown_get_up_nodes_list(3), nodeupdown_get_down_nodes_list(3), nodeupdown_is_node_up(3), nodeupdown_is_node_down(3), nodeupdown_up_count(3), nodeupdown_down_count(3), nodeupdown_last_up_time(3), nodeupdown_nodelist_create(3), nodeupdown_nodelist_clear(3), nodeupdown_nodelist_destroy(3), nodeupdown.conf(5)


and that's the whole page bestie!! this one came from LLNL, dated August 2003, and it lives in section LIBNODEUPDOWN(3) of the manual. go check if ur nodes are up, ily, bye!! πŸ«Άβœ¨πŸ’–
πŸ“¦ where this page comes from