This is very easily done using tools built by others. Simply compile the program using the standard drill using this Slackbuild. Install the package and modify the apcupsd config file to match the cable/communication settings to the device. You can also make an entry in /etc/rc.d/rc.local to start the service automatically at boot up, and you're good to go. Well, at least, it worked for me. I hope it works for you!
Here's the output from the command line utility:
root@rp-1:~#: apcupsd status
APC : 001,036,0903
DATE : 2013-01-11 09:39:55 -0700
HOSTNAME : rp-1
VERSION : 3.14.10 (13 September 2011) slackware
UPSNAME : rp-1
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2013-01-11 09:38:58 -0700
MODEL : Back-UPS XS 1200
STATUS : ONLINE
LINEV : 120.0 Volts
LOADPCT : 12.0 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 99.8 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
SENSE : Medium
LOTRANS : 097.0 Volts
HITRANS : 139.0 Volts
ALARMDEL : 30 seconds
BATTV : 27.1 Volts
LASTXFER : Automatic or explicit self test
NUMXFERS : 0
TONBATT : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
SERIALNO : JB0609014887
BATTDATE : 2006-02-22
NOMINV : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 780 Watts
FIRMWARE : 8.g1 .D USB FW:g1
END APC : 2013-01-11 09:39:55 -0700
Cool! I haven't try to monitor my ups before. Anyway, thanks for sharing I will try it some other time.
ReplyDeleteServer Racks