Hi, I need to shut down a VMWare host if both connected UPS are x minutes on battery. Both UPS are connected via SNMP. Because there are multiple vm running on that host, shutting every vm down takes some time. So most likely, waiting for low battery, the time left won't be enough. I tried overwriting the settings for low battery but that didn't work. Are timers the only possible solution to this problem? If I use timers, the host will be shut down if one of the UPS is on battery, even if the other UPS is still online. Do I need the external script to solve this? I'm grateful for any suggestions. Greetings from Germany Alexander Pilch -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20180508/064886bf/attachment.html>
On Tue, 2018-05-08 at 11:27:45 +0000, Pilch, Alexander wrote:> Hi, > > I need to shut down a VMWare host if both connected UPS are x minutes on battery. Both UPS are connected via SNMP. > Because there are multiple vm running on that host, shutting every vm down takes some time. So most likely, waiting for low battery, the time left won't be enough. I tried overwriting the settings for low battery but that didn't work. > > Are timers the only possible solution to this problem? If I use timers, the host will be shut down if one of the UPS is on battery, even if the other UPS is still online. > Do I need the external script to solve this? > > I'm grateful for any suggestions.You might tweak your NOTIFYCMD (here, /etc/nut/upssched.sh) to query both UPSes whenever it's invoked (onbatt, lowbatt, younameit). Since battery.low levels may be overridden you might wait for both UPS units to go lowbatt (as per your definition), then "flip the switch". I personally dislike timers. - S
On Tue, 8 May 2018, Pilch, Alexander wrote:> I need to shut down a VMWare host if both connected UPS are x minutes on battery.If these two UPS units are on different power supplies then it is possible for one to reach x minutes on battery while the other is still on wall power.> Are timers the only possible solution to this problem?NUT provides the MINSUPPLIES declaration in upsmon.conf to handle multiple UPS units when the setup uses status [OB] to call for a system shutdown, but if your shutdown plan is for a time based solution, then you could use NUT utility upsrw to set the battery.charge.low value to a high value corresponding to x minutes. This would get around the need for an external script. Roger
On Tue, 8 May 2018, Steffen Grunewald wrote:> I personally dislike timers.I get the impression that the majority of people on this list dislike timers, since their use suggests that the shutdown plan ignores a basic feature of a UPS unit, which is the [OB] status. Where I live, frequent lightning strikes can cause repeated power failures during a storm. The same situation exists if the power utility is unreliable. In this situation, it is better to shutdown quickly keeping enough energy in the battery for a power return and then another power failure during the storm. I see a difference between a « managed shutdown » and an « emergency shutdown ». A managed shutdown is an unfortunate, but regular occurrence, which should be well within the capacity of the UPS unit. An emergency shutdown means that not only has the power utility failed, but the UPS battery is exhausted. The managed shutdown uses timers, but the emergency shutdown on [OB] is always present, ready to take over if the number of power failures overwhelms the UPS. Timers also make it possible to run a "heartbeat" through the NUT system. In a box which can be running for months, I like to be assured that the normally quiet NUT is running correctly. For me, a "heartbeat" should be a part of every shutdown plan. Roger
Yes both UPS units are on different power supplies. MINSUPPLIES is set to 1. Afaik NUT waits for OB and LB before shutting down the system. Is there a way to change this behavior to only wait for OB? Then I would use FINALDELAY in case the power outage doesn't last long. I already tried to change the battery.runtime.low setting over the webinterface of the CS121 (snmp is readonly) but with our AEG UPS, this didn't work as expected(seems like a firmware bug) and I need to work around this problem. I'm already in contact with AEG but I also have a bunch of UPS units from other manufacturers to cover with the same controller card and different (potentially buggy) firmware... Best regards Alexander Pilch -----Ursprüngliche Nachricht----- Von: Nut-upsuser [mailto:nut-upsuser-bounces+pilch=citkomm.de at alioth-lists.debian.net] Im Auftrag von Roger Price Gesendet: Dienstag, 8. Mai 2018 17:42 An: nut-upsuser Mailing List Betreff: Re: [Nut-upsuser] how to use multiple UPS with timers On Tue, 8 May 2018, Pilch, Alexander wrote:> I need to shut down a VMWare host if both connected UPS are x minutes on battery.If these two UPS units are on different power supplies then it is possible for one to reach x minutes on battery while the other is still on wall power.> Are timers the only possible solution to this problem?NUT provides the MINSUPPLIES declaration in upsmon.conf to handle multiple UPS units when the setup uses status [OB] to call for a system shutdown, but if your shutdown plan is for a time based solution, then you could use NUT utility upsrw to set the battery.charge.low value to a high value corresponding to x minutes. This would get around the need for an external script. Roger
Reasonably Related Threads
- how to use multiple UPS with timers
- Shutdown when both (all) UPS on battery / low battery
- Dummy-ups cycles between online and onbatt every 5 minutes. (Nut 2.8.0)
- Help with Elite 800VA usb UPS
- Fopen upsmon.pid - no such file or directory - Nut 2.8.0 built from source