APC SmartUPS monitoring in Debian
From Wiki
It is possible to monitor status information from an APC UPS using the appropriate management cable and apcupsd
Connect the management cable and install the apcupsd package:
# apt-get install apcupsd
Next, configure apcupsd appropriately for your UPS. For USB management cables, set the following options in /etc/apcupsd/apcupsd.conf:
UPSCABLE usb UPSTYPE usb DEVICE
For a serial interface, the defaults will suffice, but make sure you change the serial port if not using ttyS0:
DEVICE /dev/ttyUSB0
Edit /etc/default/apcupsd to allow the daemon to start:
ISCONFIGURED=yes
Start the daemon:
# /etc/init.d/apcupsd start
Now you can interrogate the UPS:
# apcaccess APC : 001,042,1026 DATE : 2011-06-22 22:32:31 +0100 HOSTNAME : hpooxen VERSION : 3.14.8 (16 January 2010) debian UPSNAME : hpooxen CABLE : USB Cable MODEL : Smart-UPS 1500 UPSMODE : Stand Alone STARTTIME: 2011-06-22 22:23:52 +0100 STATUS : ONLINE LINEV : 239.0 Volts LOADPCT : 7.1 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 14.0 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds OUTPUTV : 239.0 Volts SENSE : High DWAKE : -01 Seconds DSHUTD : 180 Seconds LOTRANS : 208.0 Volts HITRANS : 253.0 Volts RETPCT : 000.0 Percent ITEMP : 30.6 C Internal ALARMDEL : Always BATTV : 27.4 Volts LINEFREQ : 50.0 Hz LASTXFER : No transfers since turnon NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : NO STESTI : 14 days STATFLAG : 0x07000008 Status Flag SERIALNO : nnnnnnnnnn BATTDATE : 2004-02-19 NOMOUTV : 230 Volts NOMBATTV : 24.0 Volts FIRMWARE : 601.3.I USB FW:1.5 APCMODEL : Smart-UPS 1500 END APC : 2011-06-22 22:32:55 +0100
Note: The apcaccess manpage is extremely detailed and informative - give it a look.
