1UPSCMD(8)                         NUT Manual                         UPSCMD(8)
2
3
4

NAME

6       upscmd - UPS administration program for instant commands
7

SYNOPSIS

9       upscmd -h
10
11       upscmd -l ups
12
13       upscmd [-u username] [-p password] [-w] [-t <timeout>] ups command
14

DESCRIPTION

16       upscmd allows you to invoke "instant commands" in your UPS hardware.
17       Not all hardware supports this, so check the list with -l to see if
18       anything will work on your equipment.
19
20       On hardware that supports it, you can use this program to start and
21       stop battery tests, invoke a front panel test (beep!), turn the load on
22       or off, and more.
23

OPTIONS

25       -h
26           Display the help message.
27
28       -l ups
29           Show the list of supported instant commands on that UPS. Some
30           hardware may not support any of them.
31
32       -u username
33           Set the username for the connection to the server. This is
34           optional, and you will be prompted for this when invoking a command
35           if -u is not used.
36
37       -p password
38           Set the password to authenticate to the server. This is also
39           optional like -u, and you will be prompted for it if necessary.
40
41       -w
42           Wait for the completion of command execution by the driver and
43           return its actual result from the device. Note that this feature
44           requires that both upsd and the driver support TRACKING (NUT
45           version 2.8.0 or higher) or it will otherwise fail. The command
46           will also block until an actual result is provided from the driver,
47           or the timeout is reached (see -t).
48
49       -t seconds
50           Set a timeout when using -w. Defaults to 10 seconds.
51
52       ups
53           Connect to this UPS. The format is upsname[@hostname[:port]]. The
54           default hostname is "localhost".
55

UNATTENDED MODE

57       If you run this program inside a shell script or similar to invoke a
58       command, you will need to specify all of the information on the command
59       line. This means using -u and -p. Otherwise it will put up a prompt and
60       your program will hang.
61
62       This is not necessary when displaying the list, as the username and
63       password are not required for read-only mode.
64
65       Moreover, if you run this program inside a shell script or similar, you
66       should only consider using output from stdout, not stderr.
67

DANGEROUS COMMANDS

69       Some drivers like apcsmart(8) have built-in paranoia for the dangerous
70       commands like load.off. To make them actually turn off the load, you
71       will have to send the command twice within a short window. That is, you
72       will have to send it once, then send it again after 3 seconds elapse
73       but before 15 seconds pass.
74
75       This paranoia is entirely defined within the driver. upsd and upscmd
76       have no control over the timing.
77

DIAGNOSTICS

79       upscmd won’t work unless you provide a valid username and password. If
80       you get "access denied" errors, make sure that your upsd.users(5) has
81       an entry for you, and that the username you are using has permissions
82       to SET variables.
83

BUGS

85       There is currently no way to tell the user when the driver requires
86       confirmation to invoke a command such as load.off.
87
88       This is on the list of things to fix in the future, so don’t despair.
89       It involves magic cookies.
90

SEE ALSO

92       upsd(8), upsrw(8)
93
94   Internet resources:
95       The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
96
97
98
99Network UPS Tools 2.8.0           04/26/2022                         UPSCMD(8)
Impressum