1UPSSCHED.CONF(5) Network UPS Tools (NUT) UPSSCHED.CONF(5)
2
3
4
6 upssched.conf - Configuration for upssched timer program
7
8
10 This file controls the operations of upssched(8), the timer‐based
11 helper program for upsmon(8).
12
13
15 CMDSCRIPT scriptname
16 Required. This must be above any AT lines. This script is used
17 to invoke commands when your timers are triggered. It receives
18 a single argument which is the name of the timer that caused it
19 to trigger.
20
21
22 PIPEFN filename
23 Required. This sets the file name of the socket which will be
24 used for interprocess communications. This should be in a
25 directory where normal users can't create the file, due to the
26 possibility of symlinking and other evil.
27
28 Note: if you are running Solaris or similar, the permissions
29 that upssched sets on this file are not enough to keep you safe.
30 If your OS ignores the permissions on a FIFO, then you MUST put
31 this in a protected directory!
32
33 Note 2: by default, upsmon(8) will run upssched as whatever user
34 you have defined with RUN_AS_USER in upsmon.conf(8). Make sure
35 that user can create files and write to files in the path you
36 use for PIPEFN and LOCKFN.
37
38 My recommendation: create a special directory for upssched, make
39 it owned by your upsmon user, then use it for both.
40
41 The stock version of the upssched.conf ships with PIPEFN dis‐
42 abled to make you visit this portion of the documentation and
43 think about how your system works before potentially opening a
44 security hole.
45
46
47 LOCKFN filename
48 Required. upssched attempts to create this file in order to
49 avoid a race condition when two events are dispatched from
50 upsmon at nearly the same time. This file will only exist
51 briefly. It must not be created by any other process.
52
53 You should put this in the same directory as PIPEFN.
54
55
56 AT notifytype upsname command
57 Define a handler for a specific event notifytype on UPS upsname.
58 upsname can be the special value * to apply this handler to
59 every UPS.
60
61 This will perform the command command when the notifytype and
62 upsname match the current activity. Possible values for command
63 are:
64
65 START-TIMER timername interval
66
67 Start a timer of interval seconds. When it triggers, it
68 will pass the argument timername as an argument to your
69 CMDSCRIPT.
70
71 Example:
72
73 Start a timer that'll execute when any UPS (*) has been
74 gone for 10 seconds
75
76 AT COMMBAD * START-TIMER upsgone 10
77
78 CANCEL-TIMER timername [cmd]
79
80 Cancel a running timer called <timername>, if possible.
81 If the timer has passed then pass the optional argument
82 <cmd> to CMDSCRIPT.
83
84 Example:
85
86 If a specific UPS (myups@localhost) comes back online, then
87 stop the timer before it triggers
88
89 AT COMMOK myups@localhost CANCEL-TIMER upsgone
90
91 EXECUTE command
92
93 Immediately pass <command> as an argument to CMDSCRIPT.
94
95 Example:
96
97 If any UPS (*) reverts to utility power, then execute
98 'ups-back-on-line' via CMDSCRIPT.
99
100 AT ONLINE * EXECUTE ups-back-on-line
101
102 Note that any AT that matches both the notifytype and the
103 upsname for the current event will be used.
104
105
107 upssched(8), upsmon(8)
108
109
110 Internet resources:
111 The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
112
113
114
115 Wed Nov 26 2003 UPSSCHED.CONF(5)