APC UPS control system Power Supply User Manual


 
Status logging consists of periodically logging ALL available information
concerning the UPS. Since the volume of data is rather large (over 1000
bytes per status), the STATUS data is not automatically sent to the system
log file, instead, it is written as a series of data records to a specific file
(normally /etc/apcupsd/apcupsd.status).
After each write, the file is rewound so that the size of the file remains
constant. At the current time, this file is 1135 bytes. The format of this file
is very similar to the old apcupsd procfs file. The STATUS file is kept for
backward compatibility and will be eliminated in a future version of apcupsd.
The preferred method for obtaining this information is from apcaccess or by
using the CGI interface (see apcupsd Network Monitoring [CGI] Programs).
To make reading the status data reliable via a named pipe, the first record
written contains a version number, the number of records that follow the
first record, and the total number of bytes in those subsequent records. An
actual example of such a status file (/etc/apcupsd/apcupsd.status) is:
Consequently, the first record always consists of 24 bytes (23 characters
followed by a newline). This record starts with APC and as indicated in the
example above is followed by 28 records consisting of 675 bytes. The last
record begins with END APC and contains the date and time matching the
DATE record.
Documentation of each record needs to be written. In the coming weeks,
I plan to add additional records and possibly change the names of some of
the fields.
When this data is written to a file, it is written as two records, the first
record, and all the other records together. In reading the file, it can be
either be read a record at a time, or in one big read.
When this data is written to syslog(), it is written a record at a time. The
first record is the first 24 bytes. By having the number of records and the
size in the first record, the complete status can be reliably reassembled.
Status Report Example
An example of output from an international SmartUPS 1000 follows:
DATE : Wed Sep 27 17:30:23 CEST 2000
HOSTNAME : polymatou.sibbald.com
RELEASE : 3.7.3-20000925
CABLE : Custom Cable Smart
176