NODEUPDOWN_LOAD_DATA(3)

πŸ“¦ version 1.14, in epel 9, fedora 43, fedora 44

✨ NODEUPDOWN_LOAD_DATA ✨

okay bestie, so this one lives in LIBNODEUPDOWN and it's literally the glow-up moment where your handle finally learns stuff. it's nodeupdown_load_data, and yes it's giving main character energy because without it the rest of the library is just sitting there with nothing to say 🫢


🌸 NAME 🌸

nodeupdown_load_data β€” load data. that's it. that's the vibe. she loads the data. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <nodeupdown.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so nodeupdown_load_data() pulls data from the nodeupdown backend tool's server, and the whole point is that after you do this, the rest of the nodeupdown library functions can actually do their job and properly return info about which nodes are up and which ones are down. no data loaded = no gossip. periodt.

handle is a nodeupdown handle that you made with nodeupdown_handle_create(3). no handle, no party.

hostname is supposed to tell you where the server is at. but if hostname is NULL, nodeupdown just assumes the backend tool's default server. she's flexible like that ✨

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

timeout_len is the timeout length in seconds, and it's what 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. lowkey generous.

module is optional and you can use it to specify a specific backend module for up-down calculations. if module is NULL, nodeupdown will go find the appropriate module all by herself. independent queen behavior πŸ‘‘

real talk though β€” the default values used in nodeupdown_load_data() can get overwritten if a nodeupdown configuration module is found, or if the nodeupdown configuration file is used. see libnodeupdown(3) and nodeupdown.conf(5) for the deets. and important: the nodeupdown configuration file has precedence over the configuration module. the file wins. iykyk.

πŸ’– RETURN VALUES πŸ’–

  • on success, 0 is returned. slay.
  • 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 πŸ’€

not me listing every single one, but bestie we have to, they're all here:

  • NODEUPDOWN_ERR_NULLHANDLE β€” the handle parameter is NULL. the nodeupdown handle must be created with nodeupdown_handle_create(3). like. you gotta make one first.
  • 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. the silence was too loud 😭
  • NODEUPDOWN_ERR_HOSTNAME β€” incorrect hostname specified by hostname.
  • NODEUPDOWN_ERR_ISLOADED β€” nodeupdown_load_data(3) has already been called with handle. one and done, girl.
  • 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). bestie that handle is a ghost πŸ‘»
  • 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)


and that's the whole page, bestie!! this one came from LLNL, dated November 2003 β€” yeah she's vintage but she ATE and left no crumbs πŸ’…βœ¨

πŸ“¦ where this page comes from