1
.TH UPSMON 8 "Wed May 14 2003" "" "Network UPS Tools (NUT)"
1
.TH UPSMON 8 "Wed Nov 26 2003" "" "Network UPS Tools (NUT)"
3
3
upsmon \- UPS monitor and shutdown controller
7
.B upsmon -c \fIcommand\fR
9
.B upsmon [-D] [-i] [-p] [-u \fIuser\fR]
7
.B upsmon \-c \fIcommand\fR
9
.B upsmon [\-D] [\-p] [\-u \fIuser\fR]
14
14
is the client process that is responsible for the most important part of
15
UPS monitoring - shutting down the system when the power goes out. It
15
UPS monitoring \(hy shutting down the system when the power goes out. It
16
16
can call out to other helper programs for notification purposes during
26
26
Display the help message.
28
.IP "-c \fIcommand\fR"
28
.IP "\-c \fIcommand\fR"
29
29
Send the command \fIcommand\fR to the existing upsmon process. Valid
32
fsd - shutdown all master UPSes (use with caution)
34
stop - stop monitoring and exit
36
reload - reread \fBupsmon.conf\fR(5) configuration file. See
32
fsd \(hy shutdown all master UPSes (use with caution)
34
stop \(hy stop monitoring and exit
36
reload \(hy reread \fBupsmon.conf\fR(5) configuration file. See
37
37
"reloading nuances" below if this doesn't work.
40
40
Raise the debugging level. upsmon will run in the foreground and prints
41
41
information on stdout about the monitoring process. Use this multiple
42
42
times for more details.
45
Enable infinite loop at shutdown. upsmon will keep a process running
46
after calling the shutdown command rather than exiting. This is only
47
useful if you have shutdown scripts that complain when upsmon isn't
48
running as they kill various processes.
45
Test for the shutdown flag. If it exists and contains the magic string
46
from upsmon, then upsmon will exit with EXIT_SUCCESS. Any other condition
47
will make upsmon exit with EXIT_FAILURE.
49
You can test for a successful exit from upsmon \-K in your shutdown
50
scripts to know when to call \fBupsdrvctl\fR(8) to shut down the UPS.
51
53
Run privileged all the time. Normally upsmon will split into two
52
54
processes. The majority of the code runs as an unprivileged user, and
53
55
only a tiny stub runs as root. This switch will disable that mode, and
54
56
run the old "all root all the time" system.
58
This is not the recommended mode, and you should not use this unless you
59
have a very good reason.
57
62
Set the user for the unprivileged monitoring process. This has no effect
60
65
The default user is set at configure time with 'configure
61
--with-user=...'. Typically this is 'nobody', but other distributions
66
\-\-with\-user=...'. Typically this is 'nobody', but other distributions
62
67
will probably have a specific 'nut' user for this task. If your
63
68
notification scripts need to run as a specific user, set it here.
76
81
The \fIsystem\fR refers to a \fBupsd\fR(8) server, in the form
77
82
upsname@hostname[:port]. Some examples follow:
79
- "su700@mybox" means a UPS called "su700" on a system called "mybox".
84
\(hy "su700@mybox" means a UPS called "su700" on a system called "mybox".
80
85
This is the normal form.
82
- "fenton@bigbox:5678" is a UPS called "fenton" on a system called
87
\(hy "fenton@bigbox:5678" is a UPS called "fenton" on a system called
83
88
"bigbox" which runs \fBupsd\fR(8) on port "5678".
85
90
The \fIpowervalue\fR refers to how many power supplies on this system are
90
95
Whatever password you set in that section must match the \fIpassword\fR
93
The type set in that section must also match the \fItype\fR here -
98
The type set in that section must also match the \fItype\fR here \(hy
94
99
\fBmaster\fR or \fBslave\fR. In general, a master process is one
95
100
running on the system with the UPS actually plugged into a serial
96
101
port, and a slave is drawing power from the UPS but can't talk to it
101
106
upsmon senses several events as it monitors each UPS. They are called
102
107
notify events as they can be used to tell the users and admins about the
103
change in status. See the additional NOTIFY-related sections below for
108
change in status. See the additional NOTIFY\(hyrelated sections below for
104
109
information on customizing the delivery of these messages.
219
224
On a large server with redundant power supplies, the power value for a UPS
220
225
may be greater than 1. You may also have more than one of them defined.
222
MONITOR ups-alpha@myhost 2 username mypassword master
227
MONITOR ups\-alpha@myhost 2 username mypassword master
224
MONITOR ups-beta@myhost 2 username mypassword master
229
MONITOR ups\-beta@myhost 2 username mypassword master
226
231
You can also set the power value for a UPS to 0 if it does not supply any
227
232
power to that system. This is generally used when you want to use the
322
327
However, if beta goes critical, subtracting its contribution will take the
323
328
current overall value from 3 to 2. This is just high enough to satisfy
324
329
the minimum, so the system will continue running as before. If beta
325
returns later, it will be re-added and the current value will go back to
330
returns later, it will be re\(hyadded and the current value will go back to
326
331
3. This allows you to swap out UPSes, change a power configuration, or
327
332
whatever, as long as you maintain the minimum power value at all times.
350
355
You can manually invoke this mode on the master upsmon by starting another
351
copy with '-c fsd'. This is useful when you want to initiate a shutdown
356
copy with '\-c fsd'. This is useful when you want to initiate a shutdown
352
357
before the critical stage through some external means, such as
353
358
\fBupssched\fR(8).
369
374
upsmon usually gives up root powers for the process that does most of
370
375
the work, including handling signals like SIGHUP to reload the configuration
371
376
file. This means your \fBupsmon.conf\fR(8) file must be readable by
372
the non-root account that upsmon switches to.
377
the non\(hyroot account that upsmon switches to.
374
379
If you want reloads to work, upsmon must run as some user that has
375
380
permissions to read the configuration file. I recommend making a new
379
384
See the RUN_AS_USER section in \fBupsmon.conf\fR(8) for more on this topic.
381
386
Additionally, you can't change the SHUTDOWNCMD or POWERDOWNFLAG
382
definitions with a reload due to the split-process model. If you change
387
definitions with a reload due to the split\(hyprocess model. If you change
383
388
those values, you \fBmust\fR stop upsmon and start it back up. upsmon
384
389
will warn you in the syslog if you make changes to either of those
385
390
values during a reload.
389
394
To test a synchronized shutdown without pulling the plug on your UPS(es),
390
395
you need only set the forced shutdown (FSD) flag on them. You can do this
391
by calling upsmon again to set the flag - i.e.:
396
by calling upsmon again to set the flag \(hy i.e.:
395
400
After that, the master and the slaves will do their usual shutdown sequence
396
401
as if the battery had gone critical. This is much easier on your UPS