Index: [Article Count Order] [Thread]

Date:  Fri, 09 Nov 2007 15:25:46 +0000
From:  Dogsbody <dan (at mark) dogsbody.org>
Subject:  [coba-e:11125] Re: UPS use on CBQ Servers (Apcupsd)
To:  coba-e (at mark) bluequartz.org
Message-Id:  <47347BFA.6030908 (at mark) dogsbody.org>
In-Reply-To:  <04ad01c822dd$3316d3f0$0101a8c0@systemax>
References:  <04ad01c822dd$3316d3f0$0101a8c0@systemax>
X-Mail-Count: 11125


> Does anyone have info on using a UPS (Uninterruptable Power Supply) on
> CBQ?
> I have looked at http://www.apcupsd.org/
> But have not implemented.

Here are the notes from my wiki from when I installed apcupsd...

This is based on apcupsd v3.12.4 which I installed on 22 Dec 06

1) Stop the console using ttyS0 so we can use it for the serial UPS 
connection:
$ vi /etc/inittab
  Comment out the line that is using ttyS0
$ init q
$ pkill agetty
# agetty will spring back into life on its own

2) Install the RPM
$ cd /tmp
$ wget 
http://switch.dl.sourceforge.net/sourceforge/apcupsd/apcupsd-std-3.12.4-1.el4.i386.rpm
$ rpm -ihv apcupsd-std-3.12.4-1.el4.i386.rpm
$ rm apcupsd-std-3.12.4-1.el4.i386.rpm

3) Configure:
$ vi /etc/apcupsd/apcupsd.conf
  NISIP 127.0.0.1
$ vi /etc/apcupsd/apccontrol
  I added some entries in here under powerout, onbattery,
  mainsback & doshutdown that would SMS my phone when this happened...
echo "Power loss detected" | /bin/mail -s "Alert from UPS" mo (at mark) exmpl.com

4) Setup web interface
$ mkdir /home/sites/secure.example.com/web/ups
$ cp /etc/apcupsd/cgi/* /home/sites/secure.example.com/web/ups
# CGI programs need to be owned by a valid user, they cannot be admin
$ chown -R auser /home/sites/secure.example.com/web/ups

5) Startup
$ /etc/rc.d/init.d/apcupsd start
# Note that the web interface takes a min or two to synchronise, this 
caught me out all the time.  Don't think it's not working straight away.

I hope this helps

Dan