This site is now 100% read-only, and retired.

Question: Managing UPS monitoring on Debian

Posted by simms on Wed 1 Jun 2005 at 14:17

Tags: ,

Having set up a reliable Debian `sarge' server in a production environment, I'm now eliminating any potential obstacles to running it on a round-the-clock basis. Inevitably, this has led me to hook up the machine to an uninterruptible power supply (UPS) unit, and though this alone should be enough to keep the machine running through minor power outages and line problems, it would definitely be better if the box were aware of the UPS' state, so that graceful shutdowns could be performed, at the very least.

The UPS in question is an APC Back-UPS 650, and it's connected to my Debian box via a standard 9-pin serial cable on ttyS0 (a.k.a. COM1).

Looking at the range of Debian packages available for UPS monitoring, I see nut, apcd, upsd, powstatd, and so on.

It's difficult to tell which of these is the smart way to go: nut seems to have the best reputation, but it looks like overkill, since it was designed with a whole network of UPS-dependent boxes in mind; apcd seems right for the job, but it's not very well-documented.

The others I've never even heard of.

Given the simplicity of the setup (a single machine connected to a very common UPS model in the simplest possible way), I figure that there must be a straight-forward way to get this done with maybe one package and a few lines of configuration.

Does anyone here have a method they could recommend? K.I.S.S., please :)

 

 


Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (216.12.xx.xx) on Wed 1 Jun 2005 at 17:42
I use apcupsd for monitoring a BackUPS 650 over a generic serial cable. The config file /etc/apcupsd/apcupsd.conf is well-documented and was pretty straightforward to set up. After installing it, I found that my battery is bad (not charging), so I am waiting on a replacement before I can fully test the functionality. Good luck!

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anton (66.156.xx.xx) on Wed 1 Jun 2005 at 23:22
Seconded - I'm also running apcupsd on Sarge.

I have a USB connection only (I think the model is a BackUPS 350, I didn't buy it myself). For some reason I have had problems on and off with the USB system recognizing the APC, without configuration changes on my part. I do not believe however that apcupsd is responsible for that, but I have yet to figure out what the actual cause is. Either way, this should not be a problem with a serial cable.

Anton

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (193.158.xx.xx) on Thu 2 Jun 2005 at 11:34
I'm running apcupsd as well on 3 differened sarge boxes with APC SmartUpses (1000/1400/3000) over special APC serial dongles err. cables - configuration was easy and as already said well documented. I tested it - and found it works as advertised™ (Clean shutdown / there is the possiblity to dump a database before shutdown etc). And it has a nice webinterface for monitoring.
There are even some very good hints about where to buy your batteries in the documentation (saved me 400 bucks...)
The next thing i'll want to try is the Windows (cygwin) port of it
(Packages used apcupsd/apcupsd-cgi/apcupsd-doc)

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by simms (69.157.xx.xx) on Thu 2 Jun 2005 at 13:54
thanks for the apcupsd tip, it looks like the right way to go if i'm to keep things simple -- the configuration file that's required can be trimmed down to only a few lines, so that's great.

unfortunately, i've now understood that no monitoring package will work unless i use the APC-supplied serial cable (or make my own). a truly generic serial cable simply won't work.

once the cable is located and in place, i'll post my configuration. in the meantime, thanks for all your replies.

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (128.171.xx.xx) on Sun 10 Jul 2005 at 23:45
one of the problems of apcupsd is a problematic setup to handle multiple APCs being served by a single server. As a solution I suggested a patch to init.d/acupsd available from Debian BTS Also to resolve ambiguity in USB ports assignments I've made a tiny script to identify APCs and create appropriate symlinks so .conf files have that symlinks as DEVICE. Unfortunately that host is down at the moment but if you want -- email me (debian AT onerussian.com) and I will provide you with the script :-)

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (212.18.xx.xx) on Wed 1 Jun 2005 at 22:16
Are there any packages that are Powerchute Network aware?

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (207.134.xx.xx) on Wed 1 Jun 2005 at 23:47
I'm using nut, it was not that hard to set up, and I like the graphing ability.

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (203.122.xx.xx) on Thu 2 Jun 2005 at 06:21
If you are using a linux box as a firewall, then one clever way of not worrying too much about a graceful shutdown is to run the system in a halted state. It becomes remarkably secure that way too.

Yes, I know it sounds daft. Here's the lowdown on it.

Don't know if it works for 2.4 and 2.6 kernels though.

PJ

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (201.254.xx.xx) on Tue 7 Jun 2005 at 01:20
I've setup nut, I don't think it's an overkill and I recommend it. It just does the job, and as a bonus you may have a nice WindowMaker dock app.

Regards

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Knobbe (213.46.xx.xx) on Fri 10 Jun 2005 at 21:53
ALso check this Manual if youre going to use the USB cable.

http://update.itlab.musc.edu/node/126

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by cpankonien (68.34.xx.xx) on Wed 20 Jul 2005 at 00:00
[ View Weblogs ]
I have used apcupsd for about 4 years now, both in master and slave mode, has always worked flawlessly...very cool that you can send a signal to another server on the network but of course the slave server(s) and switch should be on either the same ups, or another ups that will have sufficient runtime to keep the network up until such time as the master server gives the shut down signal. It would be nice if you could use a nstandard serial cable to connect to the ups, but then that would be too easy, wouldn't it?

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by cpankonien (68.34.xx.xx) on Wed 20 Jul 2005 at 00:05
[ View Weblogs ]
oops, should have mentioned that used apcupsd on apc smartups 1000/1500s...

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by Anonymous (62.37.xx.xx) on Wed 3 May 2006 at 09:01
im using apcupsd ver 3.10.17 with a BACKUPS 600 usb and works fine. 0 problems and easy config. documented apcupsd.conf file. good luck.

[ Parent ]

Re: Question: Managing UPS monitoring on Debian
Posted by bloodshoteye (41.134.xx.xx) on Tue 5 Jun 2012 at 11:34
On a Debian 6.04 server I connected an APC BackUPS CS 650 with a USB cable. Set apcupsd.conf sensibly, like UPSCABLE usb; UPSTYPE usb; DEVICE (blank); and ran a test using TIMEOUT 60.

The server shutdown properly. A check of apcupsd.events log showed:
[code]
2012-06-05 09:12:10 +0200 apcupsd 3.14.8 (16 January 2010) debian startup succeeded
2012-06-05 09:12:54 +0200 Power failure.
2012-06-05 09:13:00 +0200 Running on UPS batteries.
2012-06-05 09:14:01 +0200 Reached run time limit on batteries.
2012-06-05 09:14:01 +0200 Initiating system shutdown!
2012-06-05 09:14:01 +0200 User logins prohibited
2012-06-05 09:14:02 +0200 apcupsd exiting, signal 15
2012-06-05 09:14:02 +0200 apcupsd shutdown succeeded
2012-06-05 09:19:12 +0200 apcupsd 3.14.8 (16 January 2010) debian startup succeeded
[/code]

Of course a real world situation is the acid test. We have those from time to time so I shouldn't have to wait too long :-)

Cheers,

[ Parent ]