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
Hi, On Sun, 2008-06-08 at 01:45 -0700, Jamie Lists wrote:> 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.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. Regards, Michel
Jamie Lists wrote:> 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. >what Michel said... I want to add, a USB hub would not work... USB is a one master, many slave star bus. a PC is the master,, a device like your UPS is the slave. you can't connect two masters to the same USB* *there are special USB to USB network cables, these are actually two slave ports with some network glue in the middle, this doesn't violate the rule above
"Jamie Lists" <jamielist at gmail.com> schreef in bericht news:b77f4b410806080145g52f125cbv608a10ee4488aeb8 at mail.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. >If the UPS is not equipted with a network management card, then you can only connect the UPS to one server. This does not mean that you can manage only one server! The UPS software let you run custom scripts on (shutdown) events. Create ssh key-pair on second server, and create a rs(s)h script to logon with the just created ssh keys to the second server where it runs a (shutdown) script. This can also be done for the third fourth and so on. You of course run different scripts on different events.... John
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 >