Linux/UPS

APC
use

CyberPower
Use

http://www.cyberpowersystems.com/support/product-support.html

Or you can use APC with these modifications:
 * 1) /etc/apcupsd/apcupsd.conf

UPSCABLE usb UPSTYPE usb DEVICE

apctest can only perform the following with a CyberPower UPS: [?] 1)  Test kill UPS power [X]  2)  Perform self-test [X] 3)  Read last self-test result [ ]  4)  View/Change battery date [ ] 5)  View manufacturing date [X]  6)  View/Change alarm behavior [ ] 7)  View/Change sensitivity [X]  8)  View/Change low transfer voltage  (LOTRANS = 100 Volts) [X] 9)  View/Change high transfer voltage  (HITRANS = 140 Volts) [X]  10) Perform battery calibration [ ] 11) Test alarm [ ]  12) View/Change self-test interval

apcaccess interesting fields: MODEL   : UPS CP600 SERIALNO : AEC7101.251
 * 1) ups details

STATUS  : ONLINE STATUS  : ONLINE LOWBATT
 * 1) full battery
 * 1) low battery

LOADPCT :  47.0 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 12.0 Minutes LOADPCT :  48.0 Percent Load Capacity BCHARGE : 053.0 Percent TIMELEFT :  5.1 Minutes
 * 1) load level, and battery charge
 * 2) full battery
 * 1) low level battery

MBATTCHG : 5 Percent MINTIMEL : 3 Minutes ALARMDEL : 30 seconds
 * 1) levels at when the alarm goes off

NOMINV  : 120 Volts NOMPOWER : 340 Watts
 * 1) nominal voltage and wattage

apcaccess full battery example: APC     : 001,032,0795 DATE    : 2013-07-26 22:16:36 -0600 HOSTNAME : prime.t0e.org VERSION : 3.14.10 (13 September 2011) redhat UPSNAME : prime.t0e.org CABLE   : USB Cable DRIVER  : USB UPS Driver UPSMODE : Stand Alone STARTTIME: 2013-07-26 14:36:27 -0600 MODEL   : UPS CP600 STATUS  : ONLINE LINEV   : 116.0 Volts LOADPCT :  47.0 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 12.0 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds OUTPUTV : 116.0 Volts DWAKE   : 000 Seconds LOTRANS : 100.0 Volts HITRANS : 140.0 Volts ALARMDEL : 30 seconds NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : WN STATFLAG : 0x07000008 Status Flag SERIALNO : AEC7101.251 NOMINV  : 120 Volts NOMPOWER : 340 Watts END APC : 2013-07-26 22:16:41 -0600

apcaccess low battery example: APC     : 001,032,0803 DATE    : 2013-07-26 14:15:11 -0600 HOSTNAME : prime.t0e.org VERSION : 3.14.10 (13 September 2011) redhat UPSNAME : prime.t0e.org CABLE   : USB Cable DRIVER  : USB UPS Driver UPSMODE : Stand Alone STARTTIME: 2013-07-26 14:15:09 -0600 MODEL   : UPS CP600 STATUS  : ONLINE LOWBATT LINEV   : 112.0 Volts LOADPCT :  48.0 Percent Load Capacity BCHARGE : 053.0 Percent TIMELEFT :  5.1 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds OUTPUTV : 112.0 Volts DWAKE   : 000 Seconds LOTRANS : 100.0 Volts HITRANS : 140.0 Volts ALARMDEL : 30 seconds NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : WN STATFLAG : 0x07000048 Status Flag SERIALNO : AEC7101.251 NOMINV  : 120 Volts NOMPOWER : 340 Watts END APC : 2013-07-26 14:15:16 -0600

Transfer to endpoint failed
kernel: [67839.403339] Transfer to device 6 endpoint 0x1 frame 2026 failed - FIQ reported NYET. Data may have been lost.

USB Device 6 turns out to be the UPS: Bus 001 Device 006: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
 * 1) lsusb

Seems to be an intermittent issue as able to still get UPS device status with apcaccess.

The UPS is connected to a RaspberryPi and Google searches seem to show this issue appears to be isolated to the Raspberry Pi.

apcupsd
apcupsd - APC UPS power control daemon

APCUPSD User Manual - http://www.apcupsd.com/manual/
 * APCUPSD User Manual - Customizing Event Handling - http://apcupsd.org/manual/manual.html#customizing-event-handling

yum install --enablerepo=rpmforge apcupsd    # rpmforge apt-get install apcupsd
 * 1) CentOS/RedHat:
 * 1) Ubuntu


 * 1) /etc/apcupsd/apcupsd.conf

UPSCABLE usb UPSTYPE usb DEVICE

Test UPS: (apcupsd can't be running) apctest
 * 1) modify/test certain aspects of the UPS

Start the service: chkconfig apcupsd on service apcupsd restart

To get UPS details: (apcupsd must be running apcaccess

To get the field details: man apcaccess

References:
 * Controlling your battery-backup solution (UPS) with apcupsd | the kazame notepad - http://www.kazame.net/2011/04/controlling-your-battery-backup-solution-ups-with-apcupsd/

apcupsd actions scripts - "This shell script if placed in /etc/apcupsd will be called by /etc/apcupsd/apccontrol when the UPS goes on batteries. We send an email message to root to notify him." /etc/apcupsd/onbattery - when the UPS goes on batteries /etc/apcupsd/offbattery - when the UPS comes off batteries /etc/apcupsd/killpower - before apcupsd kills power in the UPS /etc/apcupsd/changeme - when battery should be replaced /etc/apcupsd/commfailure - when apcupsd loses contact with UPS /etc/apcupsd/commok - when apcupsd restores contact with UPS

NUT
Network UPS Tools - http://www.networkupstools.org/
 * Network UPS Tools (NUT) project is to provide support for Power Devices, such as Uninterruptible Power Supplies, Power Distribution Units and Solar Controllers.

UPS connected via USB: ohci_hcd 0000:00:12.0: wakeup usb 4-3: new low speed USB device using ohci_hcd and address 2 usb 4-3: configuration #1 chosen from 1 choice hiddev96,hidraw96: USB HID v1.10 Device [CPS UPS CP600] on usb-0000:00:12.0-3

Installation: mkdir -p ~/.src ; cd ~/.src wget http://www.networkupstools.org/source/2.6/nut-2.6.5.tar.gz tar -zvxf nut-2.6.5.tar.gz cd nut-2.6.5 ./configure --prefix /opt/nut make sudo make install