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

NAME

6       upssched - Timer helper for scheduling events from upsmon
7

SYNOPSIS

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

DESCRIPTION

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

INTEGRATION

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

CONFIGURATION

44       See upssched.conf(5) for information on configuring this program.
45

EARLY SHUTDOWNS

47       To shut down the system early, define a timer that starts due to an
48       ONBATT condition. When it triggers, make your CMDSCRIPT call your
49       shutdown routine. It should finish by calling upsmon -c fsd so that
50       upsmon gets to shut down the slaves in a controlled manner.
51
52       Be sure you cancel the timer if power returns (ONLINE).
53

DEBOUNCING EVENTS

55       If your UPS goes on and off battery frequently, you can use this
56       program to reduce the number of pager messages that are sent out.
57       Rather than sending pages directly from upsmon(8), use a short timer
58       here. If the timer triggers with the UPS still on battery, then send
59       the page. If the power returns before then, the timer can be cancelled
60       and no page is necessary.
61

BACKGROUND

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

FILES

94       upssched.conf(5)
95

SEE ALSO

97       upsmon(8)
98
99   Internet resources:
100       The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
101
102
103
104Network UPS Tools 2.8.0           04/26/2022                       UPSSCHED(8)
Impressum