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!
Why not use the APC PowerChute?
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1007036
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 anotherapcupsd
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.