LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Power Outage Monitoring?? (http://www.linuxquestions.org/questions/linux-server-73/power-outage-monitoring-744219/)

Biggen 07-31-2009 02:31 PM

Power Outage Monitoring??
 
How are you guys monitoring power outages? My servers are on UPS's but they only last 30 minutes or so before they drain those batteries. I'd like to write (or find) some type of script that will somehow monitor a device (that is NOT on backup power) and when that device fails, I would get a text message and e-mail to my blackberry telling me power is out.

My hope, is that I could SSH in if a power failure occurs and I could shut the boxes down safely.

Thoughts?

tredegar 07-31-2009 02:38 PM

Quote:

My hope, is that I could SSH in if a power failure occurs and I could shut the boxes down safely.
If you have a "proper" UPS, it should communicate the power status to your PC, which should take appropriate action automatically.

Please SEARCH or see /start here: http://linux.die.net/man/8/upsmon

There are other utilities as well. "You-know-who is your friend". No need to re-invent the wheel ;)

MensaWater 07-31-2009 02:44 PM

What kind of UPS do you use? If they're individual to the servers they may have built in facilities for notifying systems that power is down and allow you to use that notification for doing an automatic graceful shutdown of the server.

An example would be this one for the APC UPS:
http://www.apcupsd.org/

A simple ping test would tell you if servers are unreachable. If you have multiple servers that are unreachable that weren't on UPS you could have each of them page you (send email to your cell phone so it shows up as text message). Seeing loss of ping on multiple servers would be an indication something has gone wrong.

Of course you'd have to insure your path into the remote console (e.g. KVM, network switch etc...) was also on battery protection or you wouldn't be able to get in. Here again you could script it so that the servers on UPS are the ones doing the ping tests of the other servers and have them shutdown automatically if they see multiple other servers already down.

Biggen 07-31-2009 03:49 PM

I didn't even think of using my APC as the thing I could monitor.

I don't have the cable that it comes with so I will have to order it from them. UPSmon looks intersting...

anomie 07-31-2009 04:34 PM

FWIW, I'm also using apcupsd for this.

tredegar 07-31-2009 04:58 PM

Quote:

I didn't even think of using my APC as the thing I could monitor [SNIP] UPSmon looks intersting...
Linux can be quite surprising, in a good way.

Most problems have already been met, and (mostly) resolved, by those with more urgent needs than ours.

To be honest, I don't even have a UPS, but it looks like you are now on the right track, so I'm out of this thread. Happy configuring!


All times are GMT -5. The time now is 01:26 AM.