---
name: "libnutclient_variables"
section: "3"
platform: "linux"
package: "nut"
version: "2.8.5-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libnutclient_variables"
---

# libnutclient\_variables(3)

Variable related functions in Network UPS Tools high-level client access library

## 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 - Variable related functions in Network UPS Tools high-level client access library

## SYNOPSIS

```
        #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

These functions allow to manage variables of devices.

• The **nutclient\_get\_device\_variables()** function retrieves the list of variables names for a device.

The returned strarr must be freed by *strarr\_free* (see [**libnutclient\_general**(3)](/libnutclient_general/3.md)).

• The **nutclient\_get\_device\_rw\_variables** function retrieves the list of read-write variables names for a device.

The returned strarr must be freed by *strarr\_free* (see [**libnutclient\_general**(3)](/libnutclient_general/3.md)).

• The **nutclient\_has\_device\_variable** function tests if the specified variable is supported by the device.

Return *1* if supported and *0* if not.

• The **nutclient\_get\_device\_variable\_description** function retrieves the variable description, if any.

The returned string must be freed by [**free**(3)](/free/3.md).

• The **nutclient\_get\_device\_variable\_values** returns variable values (generally only one).

The returned strarr must be freed by *strarr\_free* (see [**libnutclient\_general**(3)](/libnutclient_general/3.md)).

• The **nutclient\_set\_device\_variable\_value** intends to set the value of the specified variable.

• The **nutclient\_set\_device\_variable\_values** intends to set multiple values of the specified variable.

Common arguments:

• *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/3.md) [**libnutclient\_devices**(3)](/libnutclient_devices/3.md) [**libnutclient\_general**(3)](/libnutclient_general/3.md)
