[CentOS] OT: really dumb question about APC UPS

Peter Farrell peter.d.farrell at gmail.com
Mon Jun 9 13:24:47 UTC 2008


Agreed:

"If you use the apcupsd software you can create a network (UPS) server
and clients which will automatically shutdown on a signal from the
server. But make sure you connect your network switch to the ups as
well ;) You then only have to connect 1 machine to the ups which will
act as a server for the other three."

You want to use the apcupsd package. Connect the one machine via
serial port / usb to the UPS.
That's your new APC server - running a master apcupd daemon.

Now set up the same daemon on the other host and they will communicate
to the APC master host to get the status of the APC unit itself. At a
user defined threshold, like '10% battery left' you can configure
shutdown events. You can space these out so you bring down your
superfluous machines (dev env) then the webservers, the app servers
and the database servers, with your intranet samba / apache as last on
the list for example. You can configure it to cascade all the machines
how ever you like.

http://www.apcupsd.org/

For example a host:
------------------------------
[peter at vega peter]$ cat /etc/apcupsd/apcupsd.conf
## apcupsd.conf v1.1 ##
#
#  for apcupsd release 3.10.15 (04 August 2004) - redhat
#
# "apcupsd" POSIX config file
#
# ========= General configuration parameters ============
UPSCABLE ether
UPSTYPE  net
DEVICE neptune.example.com:3551
LOCKFILE /var/lock
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0


And the master: (connected via serial port to APC)
-------------------------------------------------------------------------
[peter at neptune peter]$ cat /etc/apcupsd/apcupsd.conf | egrep -v '^#'
UPSCABLE smart
UPSTYPE smartups
DEVICE /dev/ttyS0
LOCKFILE /var/lock
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0

-Peter




2008/6/8 Jamie Lists <jamielist at gmail.com>:
> We have about 4 servers connected to an APC UPS. The UPS only has one
> UPS connection. So my question is, in a power outage how do i get all
> my servers to safely shutdown? Do i run a USB hub? Do i write a script
> on the one machine connected to turn off all the other machines? I'm
> confused.
>
> Jamie
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



More information about the CentOS mailing list