Optionaloptions: IRawNUTClientOptionsDestroy the client and release all resources. After calling destroy(), the client cannot be reused.
Safe to call multiple times (idempotent).
Force a shutdown on the UPS (set the FSD flag). Used by upsmon primary to signal secondaries to shut down before power loss.
The name of the UPS
The server response (e.g., "OK FSD-SET")
Get the description of an instant command. Returns a human-readable description of the command.
Check if this client is master for the UPS
Get the number of clients logged into a UPS. Returns the count of active logins.
Get the status of a previously tracked write command by its UUID.
After enabling tracking via setTracking, write commands return
OK TRACKING <uuid>. This method polls the server for the outcome of
that specific command.
The tracking UUID returned by a write command
'PENDING' if the command is still executing, 'SUCCESS' if it
completed successfully, or 'ERR' if it failed
Get the description of a UPS (from ups.conf desc= field).
The name of the UPS
The UPS description string, or "Unavailable" if not configured
Get the current value of a variable for a UPS. Returns the variable value as a string.
Get the description of a variable for a UPS. Returns a human-readable description of the variable.
Get the list of valid enum values for a variable. Returns an array of valid values for ENUM-type variables.
Get the valid range for a variable. Returns an array of valid ranges for RANGE-type variables.
Get the type of a variable for a UPS. Returns the variable type (e.g., "STRING", "NUMBER", "ENUM", "RW").
Get help information from the NUT server. Returns a list of available commands.
List clients connected to a UPS. Returns an array of client identifiers.
List instant commands for a UPS. Returns an array of command names.
List available UPS devices on the NUT server.
Array of raw protocol strings in format: 'upsname "description"'
List all variables for a UPS. Returns an array of variable names.
List read-write variables for a UPS. Returns an array of variable names that can be set.
Log out from the NUT server.
get network protocol version
Optionalevent: keyof RawNUTClientEventsRun an instant command on a UPS.
The name of the UPS
The command name
Optionalparam: string
Optional command parameter (e.g., delay in seconds)
Raw server response ('OK' or 'OK TRACKING
allow to send custom command
Optionaltimeout: number
Timeout in milliseconds. Use Infinity for no timeout.
Enable or disable command tracking for idempotent write operations.
When tracking is enabled, write commands (SET VAR, INSTCMD) return
OK TRACKING <uuid> instead of OK. The NUTClient facade parses this
response into a structured CommandResult object.
Each tracked command generates a unique UUID. Read operations (GET VAR, LIST) are not tracked.
true to enable tracking, false to disable
The raw server response (e.g. 'OK TRACKING' or 'OK')
Requires NUT 2.8.0+ (protocol v1.3) on the server. Use NUTClient for automatic parsing and TrackingOptions.followTracking for automatic polling.
Set the value of a variable for a UPS. Only works for read-write (RW) variables.
The name of the UPS
The variable name
The value to set
Raw server response ('OK' or 'OK TRACKING
OptionaltlsOptions: Omit<ConnectionOptions, "socket" | "host" | "port">get server version
Reserved for advanced uses, use NUTClient