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

NAME

6       upslog - UPS status logger
7

SYNOPSIS

9       upslog -h
10
11       upslog [OPTIONS]
12

DESCRIPTION

14       upslog is a daemon that will poll a UPS at periodic intervals, fetch
15       the variables that interest you, format them, and write them to a file.
16
17       The default format string includes variables that are supported by many
18       common UPS models. See the description below to make your own.
19

OPTIONS

21       -h
22           Display the help message.
23
24       -f format
25           Monitor the UPS using this format string. Be sure to enclose format
26           in quotes so your shell doesn’t split it up. Valid escapes within
27           this string are:
28
29           %%
30               Insert a single "%"
31
32           %TIME format%
33               Insert the time with strftime formatting
34
35           %ETIME%
36               Insert the number of seconds, ala time_t. This is now a 10
37               digit number.
38
39           %HOST%
40               insert the local hostname
41
42           %UPSHOST%
43               insert the host of the UPS being monitored
44
45           %PID%
46               insert the pid of upslog
47
48           %VAR varname%
49               insert the value of variable varname
50
51       The default format string is:
52
53           %TIME @Y@m@d @H@M@S% %VAR battery.charge% %VAR input.voltage%
54           %VAR ups.load% [%VAR ups.status%] %VAR ups.temperature%
55           %VAR input.frequency%
56
57       -i interval
58           Wait this many seconds between polls. This defaults to 30 seconds.
59
60           If you require tighter timing, you should write your own logger
61           using the upsclient(3) library.
62
63       -l logfile
64           Store the results in this file.
65
66           You can use "-" for stdout, but upslog will remain in the
67           foreground by default.
68
69       -F
70           upslog will run in the foreground, regardless of logging target.
71
72       -B
73           upslog will run in the background, regardless of logging target.
74
75       -s ups
76           Monitor this UPS. The format for this option is
77           upsname[@hostname[:port]]. The default hostname is "localhost".
78
79       -u username
80           If started as root, upslog will setuid(2) to the user id associated
81           with username for security.
82
83           If username is not defined, it will use the value that was compiled
84           into the program. This defaults to "nobody", which is less than
85           ideal.
86

SERVICE DELAYS

88       The interval value is merely the number given to sleep(3) after running
89       through the format string. Therefore, a query will actually take
90       slightly longer than the interval, depending on the speed of your
91       system.
92

ON-DEMAND LOGGING

94       Sending a USR1 signal to a running upslog process makes it wake from
95       the current sleep and log immediately. This is useful when triggered
96       from a upssched event trigger (e.g. AT ONBATT or AT ONLINE) to ensure
97       that an entry always exists, even if the power goes away for a period
98       of time shorter than that specified by the -i argument.
99

LOG ROTATION

101       upslog writes its PID to upslog.pid, and will reopen the log file if
102       you send it a SIGHUP. This allows it to keep running when the log is
103       rotated by an external program.
104

SEE ALSO

106   Server:
107       upsd(8)
108
109   Clients:
110       upsc(8), upscmd(8), upsrw(8), upsmon(8), upssched(8)
111
112   Internet resources:
113       The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
114
115
116
117Network UPS Tools 2.8.0           04/26/2022                         UPSLOG(8)
Impressum