We use NUT. We also try to run upsmon on the machines that are plugged into the UPS.
Configuration
The NUT configuration files live in /etc/nut.
Topology
gallium <-> Rack 0 UPS; APC Smart UPS 2200 XL (upsium)
- ?
... see CategoryPluggedInUpsium (though it probably isn't accurate yet)
erbium <-> Rack 6 UPS; APC Smart UPS 2200 (graphite)
... see CategoryPluggedInGraphite
TBD <-> Rack 4 UPS; APC Smart UPS 2200 (halite)
- ?
TBD <-> Rack 5 UPS; APC Smart UPS 1500 (feldspar)
- ?
NUT 2.0
Some aspects of configuration have changed in NUT 2.0 (ships with wheezy). Namely:
- ACL is no longer supported in upsd.conf; instead use hosts.allow/hosts.deny.
- allowfrom is no longer supported in upsd.users; instead use hosts.allow/hosts.deny.
- UPS driver runs as the NUT user. Easiest way to give him access to the appropriate device is to add the "nut" user to dialout.
See what I did on IODINE. (Which I was going to use as the UPS monitor for graphite
Another thing to note, is that wheezy appears to install brltty for some reason or another. It is EVIL and disconnects FTDI devices thinking they're braille terminals. You need to remove the "brltty" package in order to use the serial converts we bought for UPS monitoring.
On gallium
- ups.conf - specifies the UPS name (upsium), driver (apcsmart), and serial port (/dev/ttyS1)
- upsd.conf - specifies access controls to upsd, the main NUT daemon; only allow club hosts to monitor the UPS
- upsd.users - user names, passwords, and privileges for access to upsd
- upsmon.conf - specifies that gallium is the master for monitoring; gives information so upsmon can connect to upsd
In /etc/default/nut, specify START_UPSD=yes and START_UPSMON=yes.
Also one important thing to remember, is that you need a nut user. If you forget, you get the helpful error message "getpwnam(nut): Success" (at least in the sarge version).
nut:x:50:104::/var/lib/nut:/bin/false
On others
- upsmon.conf - specifies that the upsd on gallium should be monitored; gives information so upsmon can connect to the upsd on gallium
In /etc/default/nut, specify START_UPSMON=yes.
How It Handles Issues
TODO: kbare - verify this is true.
When the battery level of the UPS becomes critical, the upsmon processes will notice, and initiate a system shutdown. The master will wait for all of the slaves to shut down, and then it will shut itsefl down, and power off the UPS.