1UPSSCHED(8)                 Network UPS Tools (NUT)                UPSSCHED(8)
2
3
4

NAME

6       upssched - Timer helper for scheduling events from upsmon
7

SYNOPSIS

9       upssched
10

NOTE

12       upssched  should  be  run from upsmon(8) via the NOTIFYCMD.  You should
13       never run it directly during normal operations.
14
15

DESCRIPTION

17       upssched was created to allow users to execute programs at times  rela‐
18       tive  to events being monitored by upsmon(8).  The original purpose was
19       to allow for a shutdown to occur after some fixed  period  on  battery,
20       but there are other uses that are possible.
21
22

INTEGRATION

24       upssched  needs  to  be called as the NOTIFYCMD in your upsmon.conf(5).
25       It determines what is happening based on  the  UPSNAME  and  NOTIFYTYPE
26       environment  variables.   You  should  never  have  to  deal  with them
27       directly.
28
29       Set the EXEC flag on the events that you want to see in upssched.   For
30       example, to make sure that upssched hears about ONLINE, ONBATT and LOW‐
31       BATT events, the flags would look like this:
32
33
34                   NOTIFYFLAG ONLINE EXEC
35                   NOTIFYFLAG ONBATT EXEC
36                   NOTIFYFLAG LOWBATT EXEC
37
38       If you also want to continue writing to the syslog, just add it in:
39
40
41                   NOTIFYFLAG ONLINE SYSLOG+EXEC
42                   NOTIFYFLAG ONBATT SYSLOG+EXEC
43                   NOTIFYFLAG LOWBATT SYSLOG+EXEC
44
45       For a full list of notify flags, see the upsmon(8) documentation.
46
47

CONFIGURATION

49       See upssched.conf(5) for information on configuring this program.
50
51

EARLY SHUTDOWNS

53       To shut down the system early, define a timer that  starts  due  to  an
54       ONBATT  condition.   When  it  triggers,  make your CMDSCRIPT call your
55       shutdown routine.  It should finish by calling "upsmon -c fsd" so  that
56       upsmon gets to shut down the slaves in a controlled manner.
57
58       Be sure you cancel the timer if power returns (ONLINE).
59
60

DEBOUNCING EVENTS

62       If  your  UPS goes on and off battery frequently, you can use this pro‐
63       gram to reduce the number of pager messages that are sent out.   Rather
64       than sending pages directly from upsmon(8), use a short timer here.  If
65       the timer triggers with the UPS still on battery, then send  the  page.
66       If  the  power  returns  before then, the timer can be cancelled and no
67       page is necessary.
68
69

BACKGROUND

71       This program was written primarily to fulfill the requests of users for
72       the  early  shutdown  scenario.   The  "outboard" design of the program
73       (relative to upsmon) was intended to reduce the  load  on  the  average
74       system.   Most people don't have the requirement of shutting down after
75       n seconds on battery, since the usual OB+LB testing is sufficient.
76
77       This program was created separately so those people don't have to spend
78       CPU time and RAM on something that will never be used in their environ‐
79       ments.
80
81       The design of the timer  handler  is  also  geared  towards  minimizing
82       impact.   It will come and go from the process list as necessary.  When
83       a new timer is started, a process will be forked to actually watch  the
84       clock and eventually start the CMDSCRIPT.  When a timer triggers, it is
85       removed from the queue.  Cancelling a timer will also  remove  it  from
86       the  queue.   When  no  timers are present in the queue, the background
87       process exits.
88
89       This means that you will only see upssched  running  when  one  of  two
90       things is happening:
91
92       ‐ There's a timer of some sort currently running
93
94       ‐ upsmon just called it, and you managed to catch the brief instance
95
96       The  final  optimization  handles the possibility of trying to cancel a
97       timer when there are none running.  If the timer daemon isn't  running,
98       there  are  no  timers  to  cancel, and furthermore there is no need to
99       start a clock‐watcher.  So, it skips that step and exits sooner.
100
101

FILES

103       upssched.conf(5)
104
105

SEE ALSO

107       upsmon(8)
108
109
110   Internet resources:
111       The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
112
113
114
115                                Wed Feb  6 2002                    UPSSCHED(8)
Impressum