NODEUPDOWN_IS_NODE_UP(3)

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

✨ NAME ✨

nodeupdown_is_node_up, nodeupdown_is_node_down β€” test if a node is up or down

Ok so real quick, this is a page from LIBNODEUPDOWN (yes bestie, the NODEUPDOWN_IS_NODE_UP(3) one) and it's literally just two little functions that answer the most basic question in all of cluster life: is this node up, or is it down? πŸ’…


πŸ’– SYNOPSIS πŸ’–

#include <nodeupdown.h>

int nodeupdown_is_node_up(nodeupdown_t handle, const char *node); q.sp
int nodeupdown_is_node_down(nodeupdown_t handle, const char *node);

πŸ¦‹ DESCRIPTION πŸ¦‹

nodeupdown_is_node_up() tests if the node pointed to by node is up. That's it. That's the whole job. ✨

nodeupdown_is_node_down() tests if the node pointed to by node is down. Same energy, opposite direction. 🫢

Heads up bestie: the node name you pass into these functions must be the shortened name of the hostname. Not the long one, not the FQDN, the short one. Don't be the girl who passes the full hostname and then wonders why nothing works 😭

🌸 RETURN VALUES 🌸

For nodeupdown_is_node_up():

  • 1 gets returned if the node is up 🟒
  • 0 gets returned if the node is down πŸ”΄

For nodeupdown_is_node_down():

  • 1 gets returned if the node is down πŸ”΄
  • 0 gets returned if the node is up 🟒

On error, both of them return -1, and an error code is returned in handle. You can pull that error code out with nodeupdown_errnum(3), and a whole description of what that error code even means comes from nodeupdown_strerror(3). The error codes themselves live in nodeupdown.h. iykyk πŸ‘‘


πŸ”₯ ERRORS πŸ”₯

  • NODEUPDOWN_ERR_NULLHANDLE β€” the handle parameter is NULL. The nodeupdown handle must be created with nodeupdown_handle_create(3). like girl you gotta make the handle first 😭
  • NODEUPDOWN_ERR_NOTLOADED β€” nodeupdown_load_data(3) has not been called and no data has been retrieved. no data, no answers, periodt.
  • NODEUPDOWN_ERR_PARAMETERS β€” an incorrect parameter has been passed in. πŸ™ˆ
  • NODEUPDOWN_ERR_OUTMEM β€” malloc(3) has failed internally. πŸ’€
  • NODEUPDOWN_ERR_NOTFOUND β€” the node pointed to by node is not known. never heard of her.
  • NODEUPDOWN_ERR_CLUSTERLIST_MODULE β€” internal error with the clusterlist module
  • NODEUPDOWN_ERR_HOSTLIST β€” hostlist API has failed internally.
  • 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). the magic number said no πŸ’…

πŸŽ€ FILES πŸŽ€

  • /usr/include/nodeupdown.h

πŸ‘‘ SEE ALSO πŸ‘‘

libnodeupdown(3), nodeupdown_handle_create(3), nodeupdown_load_data(3), nodeupdown_errnum(3), nodeupdown_strerror(3)


ok that's the whole page bestie, go forth and check your nodes 🌈

This little masterpiece came from LLNL (LIBNODEUPDOWN), dated August 2003 β€” yes, it's vintage, and yes, it still ate. πŸ’–

πŸ“¦ where this page comes from