Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a couple APC UPS -

  • Smart-UPS RT 6000 RM XL
  • Smart-UPS RT 5000 RM XL

Unfortunately the power in my office likes to go out (out of my control) and hence the equipment powered by these UPS shuts down. They power a VMware infrastructure environment (VMware Lab Manager) and what I'd like to do is detect when one is on battery (say has been for x amount of time or has x percentage left) and run a script on this event.

What software do I need to detect a on-battery event and have it run a script?

Thanks!

share|improve this question
    
Did you check rear the Smart-UPS? Usually these models have already pre-installed the SmartSlot™ Card (with network port). –  lg. Sep 10 '12 at 12:36

2 Answers 2

Why not use the APC PowerChute?

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1007036

share|improve this answer
    
The only comment I would add is that this may also required the purchase and installation of an APC Smart-UPS Network Card in order for the batteries to trigger remote shutdowns and even WOL. –  Brent Pabst Sep 10 '12 at 12:33
    
Thanks, I was thinking of using PowerChute and hooking up a system via USB but I didn't know if PowerChute could be configured to run a script when the UPS goes on battery. I'll give it a try. I also came across PowerChute Network Shutdown and wasn't sure if this was more of what I wanted... –  Andy Arismendi Sep 10 '12 at 12:38

You can use apcupsd, it's in most repositories. It supports both USB and RS232 connections as well as networked communication (where the network server can be both the UPS itself as well as another apcupsd instance).

It has default scripts that should gracefully shutdown your machine. The scripts that do that are defined in apcupsd config file, you should be able to switch them to something different.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.