~ubuntu-branches/ubuntu/saucy/nut/saucy

« back to all changes in this revision

Viewing changes to man/upsmon.8

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-07-20 19:48:50 UTC
  • mto: (16.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050720194850-oo61wjr33rrx2mre
Tags: upstream-2.0.2
ImportĀ upstreamĀ versionĀ 2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH UPSMON 8 "Wed May 14 2003" "" "Network UPS Tools (NUT)" 
 
1
.TH UPSMON 8 "Wed Nov 26 2003" "" "Network UPS Tools (NUT)" 
2
2
.SH NAME
3
3
upsmon \- UPS monitor and shutdown controller
4
4
.SH SYNOPSIS
5
 
.B upsmon -h
6
 
 
7
 
.B upsmon -c \fIcommand\fR
8
 
 
9
 
.B upsmon [-D] [-i] [-p] [-u \fIuser\fR]
 
5
.B upsmon \-h
 
6
 
 
7
.B upsmon \-c \fIcommand\fR
 
8
 
 
9
.B upsmon [\-D] [\-p] [\-u \fIuser\fR]
10
10
 
11
11
.SH DESCRIPTION
12
12
 
13
13
.B upsmon
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
17
17
power events.
18
18
 
22
22
 
23
23
.SH OPTIONS
24
24
 
25
 
.IP -h
 
25
.IP \-h
26
26
Display the help message.
27
27
 
28
 
.IP "-c \fIcommand\fR"
 
28
.IP "\-c \fIcommand\fR"
29
29
Send the command \fIcommand\fR to the existing upsmon process.  Valid
30
30
commands are:
31
31
 
32
 
fsd - shutdown all master UPSes (use with caution)
33
 
 
34
 
stop - stop monitoring and exit
35
 
 
36
 
reload - reread \fBupsmon.conf\fR(5) configuration file.  See
 
32
fsd \(hy shutdown all master UPSes (use with caution)
 
33
 
 
34
stop \(hy stop monitoring and exit
 
35
 
 
36
reload \(hy reread \fBupsmon.conf\fR(5) configuration file.  See
37
37
"reloading nuances" below if this doesn't work.
38
38
 
39
 
.IP -D
 
39
.IP \-D
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.
43
43
 
44
 
.IP -i
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.
49
 
 
50
 
.IP -p
 
44
.IP \-K
 
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.  
 
48
 
 
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
 
 
52
.IP \-p
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.
55
57
 
56
 
.IP "-u \fIuser\fR"
 
58
This is not the recommended mode, and you should not use this unless you
 
59
have a very good reason.
 
60
 
 
61
.IP "\-u \fIuser\fR"
57
62
Set the user for the unprivileged monitoring process.  This has no effect
58
 
when using -p.
 
63
when using \-p.
59
64
.IP
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.
64
69
.IP
76
81
The \fIsystem\fR refers to a \fBupsd\fR(8) server, in the form
77
82
upsname@hostname[:port].  Some examples follow:
78
83
 
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.
81
86
 
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".
84
89
 
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
91
96
set in this file.  
92
97
 
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
100
105
 
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.
105
110
 
106
111
.IP ONLINE
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.
221
226
 
222
 
        MONITOR ups-alpha@myhost 2 username mypassword master
 
227
        MONITOR ups\-alpha@myhost 2 username mypassword master
223
228
 
224
 
        MONITOR ups-beta@myhost 2 username mypassword master
 
229
        MONITOR ups\-beta@myhost 2 username mypassword master
225
230
 
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.
328
333
 
348
353
on the master.
349
354
 
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).
354
359
 
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.
373
378
 
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.
380
385
 
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.
388
393
 
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.:
392
397
 
393
 
        upsmon -c fsd
 
398
        upsmon \-c fsd
394
399
 
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