Here are some notes on my configuration of a battery backup system on the computers in my office, using an American Power Conversion BackUPS Pro 1400, with the software package NUT version 1.2.0.
NOTE: If you use NUT like I did, one of your computers must be a unix machine!
There are three main components of NUT:

First, I installed NUT on vesuvio only. I went to the web page, downloaded it and unpacked it with no problems. Then I followed the steps in the INSTALL file, referring to the README file as well as the man pages [1].
Steps 1 through 4 went just fine.
Step 5: I edited ups.conf to look as follows:
[upsvesuvio]
driver = genericups
port = /dev/ttyS0
upstype = 2
Step 6: before typing
/usr/local/ups/bin/upsdrvctl start,
I found it was necessary to first type:
chmod a+r /dev/ttyS0
chmod a+w /dev/ttyS0
Step 7: No problems here.
Step 8:
When starting the network server, /usr/local/ups/sbin/upsd,
I got the error message:
Can't bind to socket: Address already in use
I ignored this and kept going. Supposedly it means that upsd is
already running, but in any case, it doesn't matter.
Step 9: When you type /usr/local/ups/bin/upsc localhost, if you see the text STATUS: OL, then the UPS is using utility power (OL = OnLine) and things are working.
Step 1: I edited upsd.conf to look like this:
ACL all 0.0.0.0/0 ACL localhost 127.0.0.1/32 ACCESS grant monitor localhost ACCESS deny all allThe /32 means that 127.0.0.1 is an individual host. Other numbers like /27 correspond to whole networks. This configuration file defines localhost to be the local host, and grants it permission to monitor the status of the UPS.
Step 2: I edited upsd.users to look like this:
[admin]
password = ADMINPASS
allowfrom = localhost
actions = SET
instcmds = ALL
[monmaster]
password = MASTERPASS
allowfrom = localhost
upsmon master
[monuser]
password = USERPASS
allowfrom = localhost
upsmon slave
This file defines 3 "users", admin, monmaster and
monuser. I believe for the 1-computer case that we are
discussing here, monuser is unnecessary (but it doesn't hurt
anything, and we might as well). allowfrom specifies the host
that the user is allowed to log in from. upsmon master means
that the computer will wait until the last possible moment (battery going
critical) to shutdown, whereas upsmon slave means that the
computer will shut down as soon as utility power goes down. At least,
this is what I think happens. The NUT documentation is very unclear on this.
Step 3: I edited upsmon.conf to look like:
MONITOR upsvesuvio@localhost 1 monmaster MASTERPASS master # I edited this MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" NOTIFYCMD /usr/local/ups/bin/notifyme # I added this POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC # I added this NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC # I added this NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC # I added this NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC # I added this NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC # I added this NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC # I added this NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC # I added this NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC # I added this NOTIFYFLAG FSD SYSLOG+WALL+EXEC # I added this RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5
#!/bin/sh echo "$*" | sendmail -i -fUPS rootVery simple, it just sends the UPS message ($*) along to root in an email. I am root, so I get email notification as soon as anything happens. NOTE: it didn't work until I did chown nobody notifyme.
Steps 4 through 6: I had no problems with these
Step 7: I don't really understand what this is about. I haven't configured anything like they are talking about, and I haven't had any problems.
We're not quite done! Sure, we can manually start things by typing
% cd /usr/local/ups/ % bin/upsdrvctl start # start driver % sbin/upsd # start daemon % bin/upsc localhost # optional - gives UPS status % sbin/upsmon # start the monitor...but we would prefer the computer do all this automatically whenever it is rebooted. It's not just a convenience, it's a necessity, because there could be multiple power outages when we aren't around to manually start things.
Well, in the directory /usr/local/ups/scripts/RedHat-6.0/ I found the scripts upsd, upsmon and upspowerdown, which I copied over into the directory /etc/rc.d/init.d/. Unfortunately, they don't work out of the box. Other than the obvious need to chmod a+x ups*, they need to be edited a bit, since they assume everything is in the current working directory, which is not the case.
I added ... mention prefix env var, and adding paths to everything
THIS DOCUMENT IS UNFINISHED!more to come....