LIBNUTCLIENT_VARIABL(3)

πŸ’– LIBNUTCLIENT_VARIABL β€” the NUT Manual, section 3, bestie edition πŸ’–

okay so. welcome to LIBNUTCLIENT_VARIABL(3), aka the page where we learn how to talk to variables on your devices through the Network UPS Tools high-level client access library. this is giving "let me just peek at what my UPS is up to" energy and honestly? obsessed. πŸ¦‹


✨ NAME ✨

libnutclient_variables, nutclient_get_device_variables, nutclient_get_device_rw_variables, nutclient_has_device_variable, nutclient_get_device_variable_description, nutclient_get_device_variable_values, nutclient_set_device_variable_value, nutclient_set_device_variable_values β€” the variable-related functions in the Network UPS Tools high-level client access library. πŸ’…


🌸 SYNOPSIS 🌸

like, here's the whole vibe, verbatim:

#include <nutclient.h>

typedef void* NUTCLIENT_t;

typedef char** strarr;

strarr nutclient_get_device_variables(NUTCLIENT_t client,
        const char* dev);

strarr nutclient_get_device_rw_variables(NUTCLIENT_t client,
        const char* dev);

int nutclient_has_device_variable(NUTCLIENT_t client,
        const char* dev, const char* var);

char* nutclient_get_device_variable_description(NUTCLIENT_t client,
        const char* dev, const char* var);

strarr nutclient_get_device_variable_values(NUTCLIENT_t client,
        const char* dev, const char* var);

void nutclient_set_device_variable_value(NUTCLIENT_t client,
        const char* dev, const char* var, const char* value);

void nutclient_set_device_variable_values(NUTCLIENT_t client,
        const char* dev, const char* var, const strarr values);

πŸŽ€ DESCRIPTION πŸŽ€

so these functions let you manage the variables of devices. that's the whole plot. let's go one by one, no skips, no cap. ✨

  • nutclient_get_device_variables() β€” pulls up the list of variable names for a device. πŸ“‹

the strarr it hands back must be freed by strarr_free (peep libnutclient_general(3) for that).

  • nutclient_get_device_rw_variables β€” same vibe but it gets the list of read-write variable names for a device. the ones you're actually allowed to touch. πŸ‘‘

the returned strarr must be freed by strarr_free (see libnutclient_general(3)).

  • nutclient_has_device_variable β€” checks whether the variable you're asking about is even supported by the device. a lil vibe check. πŸ”

returns 1 if it's supported and 0 if it's not. simple as that.

  • nutclient_get_device_variable_description β€” grabs the variable's description, if any exists. πŸ™ˆ

the returned string must be freed by free(3).

  • nutclient_get_device_variable_values β€” returns the variable's values (generally there's only one, but bestie, sometimes life surprises you). πŸ’«

the returned strarr must be freed by strarr_free (see libnutclient_general(3)).

  • nutclient_set_device_variable_value β€” intends to set the value of the specified variable. ✍️
  • nutclient_set_device_variable_values β€” intends to set multiple values of the specified variable. a whole set, together, iconic. 🫢

🌈 common arguments (iykyk)

  • dev is the device name. πŸ–₯️
  • var is the variable name. 🏷️
  • value is the variable value. πŸ“
  • values is the variable array of values. 🧺

πŸ”₯ SEE ALSO πŸ”₯

libnutclient(3) libnutclient_devices(3) libnutclient_general(3)


and that's the whole page, bestie β€” this was Network UPS Tools 2.8.5, dated 10/07/2026, and that's LIBNUTCLIENT_VARIABL(3), slay, periodt. πŸ’œπŸ§šβ­

πŸ“¦ where this page comes from