UPS devices and linux

Several of our linux machines are plugged into UPS devices. And several of our UPS devices have cables that plug into the computers so they can tell the computer when they are about to loose power (a good concept).

More modern units (most of ours are made by APC) connect right to a USB port (this is good). Older units have a DB-9 serial port and connect to a PC serial port or via a dongle to a USB port.

Our systems use the nut package, which seems to be a manufacturer agnostic UPS support package for linux. This is available via yum for our fedora systems, you want to install two packages:

yum install nut nut_client
Alternately you can download the APC proprietary "PBE powerchute" software for linux. I tried this and it immediately got into a snit about Java versions, so I gave up on it. Why fuss with this when you can use nut.

The config files for nut are:

/etc/sysconfig/ups
/etc/ups/upsd.conf
/etc/ups/ups.conf
/etc/ups/*

The key pieces of software to run nut are:

/sbin/upsdrvctl
/usr/sbin/upsd
/usr/bin/upsc

As of version 2.4.1 of nut, it spews out messages that the ACL and ACCEPT commands have been replaced by LISTEN, but there is no documentation about any of this.

The whole shebang gets launched by a couple of lines in /etc/rc.local:

upsdrvctl -u root start myups
upsd -u root

To see if things are working, try this:

upsc myups@localhost

Have any comments? Questions? Drop me a line!

Adventures in Computing / [email protected]