LIBNUTCLIENT_COMMAND(3)

πŸŽ€ NAME πŸŽ€

okay so this page is the whole girlboss squad of instant-command functions in the Network UPS Tools high-level client access library: libnutclient_commands, nutclient_get_device_commands, nutclient_has_device_command, nutclient_get_device_command_description, and nutclient_execute_device_command. they're the ones that handle instant commands. no cap. πŸ’…


✨ SYNOPSIS ✨

#include <nutclient.h>

typedef void* NUTCLIENT_t;

typedef char** strarr;

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

int nutclient_has_device_command(
        NUTCLIENT_t client,
        const char* dev, const char* cmd);

char* nutclient_get_device_command_description(
        NUTCLIENT_t client,
        const char* dev, const char* cmd);

void nutclient_execute_device_command(
        NUTCLIENT_t client,
        const char* dev, const char* cmd,
        const char* param="");

πŸ’– DESCRIPTION πŸ’–

these functions are literally here so you can manage instant commands of devices. bestie, it's giving remote-control energy for your UPS. πŸ¦‹

  • The nutclient_get_device_commands() function retrieves the list of command names for a device.
heads up! the returned strarr must be freed by strarr_free. don't ghost it, free it. 😭
  • The nutclient_has_device_command function tests if the specified command is supported by the device.

Return 1 if supported and 0 if not. simple as that, it's a vibe check on the command. βœ…

  • The nutclient_get_device_command_description function retrieves the command description, if any.

The returned string must be freed by free(3) (see libnutclient_general(3)). yes, with the regular free, not the fancy one. πŸ’€

  • The nutclient_execute_device_command intends to execute the instant command, with an optional parameter.

go ahead, press the button, main character energy only. πŸ”₯

🌸 Common arguments 🌸

  • dev is the device name.
  • cmd is the instant command name.

πŸ‘‘ SEE ALSO πŸ‘‘

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


and that's the whole page, bestie πŸ’œ this one's from Network UPS Tools 2.8.5, dated 10/07/2026 β€” iconic, timeless, periodt. 🫢✨🌈

πŸ“¦ where this page comes from