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

NAME

6       upslog - UPS status logger
7

SYNOPSIS

9       upslog -h
10
11       upslog [OPTIONS]
12
13

DESCRIPTION

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

OPTIONS

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

SERVICE DELAYS

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

LOG ROTATION

93       upslog  writes  its  pid to upslog.pid, and will reopen the log file if
94       you send it a SIGHUP.  This allows it to keep running when the  log  is
95       rotated by an external program.
96
97

SEE ALSO

99   Server:
100       upsd(8)
101
102
103   Clients:
104       upsc(8), upscmd(8), upsrw(8), upsmon(8)
105
106
107   Internet resources:
108       The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
109
110
111
112                                Sat May 10 2003                      UPSLOG(8)
Impressum