UPSLOG(8) | NUT Manual | UPSLOG(8) |
upslog - UPS status logger
upslog -h
upslog [OPTIONS]
upslog is a daemon that will poll a UPS at periodic intervals, fetch the variables that interest you, format them, and write them to a file.
The default format string includes variables that are supported by many common UPS models. See the description below to make your own.
-h
-f format
%%
%TIME format%
%ETIME%
%HOST%
%UPSHOST%
%PID%
%VAR varname%
The default format string is:
%TIME @Y@m@d @H@M@S% %VAR battery.charge% %VAR input.voltage% %VAR ups.load% [%VAR ups.status%] %VAR ups.temperature% %VAR input.frequency%
-i interval
If you require tighter timing, you should write your own logger using the upsclient(3) library.
-l logfile
You can use "-" for stdout, but upslog will remain in the foreground.
-s ups
-u username
If username is not defined, it will use the value that was compiled into the program. This defaults to "nobody", which is less than ideal.
The interval value is merely the number given to sleep(3) after running through the format string. Therefore, a query will actually take slightly longer than the interval, depending on the speed of your system.
Sending a USR1 signal to a running upslog process makes it wake from the current sleep and log immediately. This is useful when triggered from a upssched event trigger (e.g. AT ONBATT or AT ONLINE) to ensure that an entry always exists, even if the power goes away for a period of time shorter than that specified by the -i argument.
upslog writes its PID to upslog.pid, and will reopen the log file if you send it a SIGHUP. This allows it to keep running when the log is rotated by an external program.
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
12/29/2015 | Network UPS Tools 2.7.3. |