Is it possible to trigger a script that begins the shutdown of servers when a battery on a UPS gets low? Anyone accomplish this or have any idea if its even possible?
This is more of an NPM thing - custom universal polling on the UPS, then an alert based on the 20% battery threshold - collected by that undp you set up.
Use the script action in the alerts to trigger the shutdown. That last could get interesting - I will let others with experience of that action reply to that part.
If they are virtual and you have vim linked, you could leverage some of the vim actions too.
Ohhh - you may want to increase the polling rate from the default five minutes to maybe one minute to get quicker information on that rapidly decreasing battery life...
There might be other methods, but without checking the ups capabilities, it is hard to determine.