= APC UPS Battery-Backed Power Supply Monitor for CentOS ==

The APC Smart-UPS battery-backup devices in the lab support using a daemon, running on CentosOS, which monitors the power-state of the UPS, and if there is a power failure, and the battery is getting close to empty, it will initiate an automatic shutdown. This shutdown won't of course 'save' any open docs you might have, but it will 'cleanly' shutdown the computer, which can prevent the corruption of the hard disk if power to the computer were to otherwise just turn off when the battery drains.

To install this, sudo access, or the help of nmrhelp, is needed. These the steps:

BUILD SOURCE

goto: http://www.apcupsd.org/

get source code and build, note that --enable-usb must be included

./configure --enable-usb make make install

EDIT CONFIG

edit /etc/apcupsd/apcupsd.conf and set the following fields:

UPSCABLE usb

UPSTYPE usb DEVICE

note that 'DEVICE' is empty. you could also optionally set:

UPSNAME TERRIER-APC-UPS

FIRST-TIME START AND CHECK

sudo /etc/rc.d/init.d/apcupsd start

/sbin/apcaccess

in the output of apcaccess, make sure 'STATUS' is ONLINE, confirming USB connection.

the start command is only necessary after first-time install. or you can just reboot the system, and just run /sbin/apcaccess to confirm that apcupsd is actually running.

TEST

tail the /var/log/messages file and then unplug the power cord from the UPS