Charles Lepple
2014-Jan-21 12:20 UTC
[Nut-upsuser] Shutdown when both (all) UPS on battery / low battery
On Jan 21, 2014, at 3:16 AM, Rafa? Oleszek wrote:> I would like to mention that MINSUPPLIES manipulation doesn't work. My nut version is : 2.2.2-4 (RHEL 5)What do your configuration files look like? Setting MINSUPPLIES to 2 should work. You can run upsmon with a debug level of 3 or greater, and it will print the current and minimum "power value", which is what determines when to shut down. Also, if you don't want to wait for both UPSes to drain to the low battery state, you can set up a pair of dummy-ups drivers. I'm not sure how well that will work with 2.2.2, but since dummy-ups doesn't require hardware, you could build a newer version of NUT on another system, and configure it to only build the dummy-ups driver. -- Charles Lepple clepple at gmail
RafaĆ Oleszek
2014-Jan-21 13:05 UTC
[Nut-upsuser] Shutdown when both (all) UPS on battery / low battery
> What do your configuration files look like? Setting MINSUPPLIES to 2 should work. You can run upsmon with a debug level of 3 or greater, and it will print the current and minimum "power value", which is what determines when to shut down. > > Also, if you don't want to wait for both UPSes to drain to the low battery state, you can set up a pair of dummy-ups drivers. I'm not sure how well that will work with 2.2.2, but since dummy-ups doesn't require hardware, you could build a newer version of NUT on another system, and configure it to only build the dummy-ups driver. >Thank you for your reply. I tested configuration on live environment and on dummy-ups. I also built the newest NUT version, tested on dummy-ups and it didn't work with my config. My config files: upsmon.conf: RUN_AS_USER root MONITOR UPS_251 at localhost 2 monmaster password master MONITOR UPS_252 at localhost 2 monmaster password master MINSUPPLIES 2 SHUTDOWNCMD "/etc/ups/test" NOTIFYCMD /usr/sbin/upssched POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 30 POWERDOWNFLAG /etc/killpower NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC NOTIFYFLAG COMMOK SYSLOG+WALL NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5 upssched.conf: CMDSCRIPT /usr/bin/upssched-cmd PIPEFN /var/run/nut/upssched.pipe LOCKFN /var/run/nut/upssched.lock AT COMMBAD * EXECUTE upsgone AT ONBATT * START-TIMER onbatt 30 AT LOWBATT * START-TIMER lowbatt 130 AT ONLINE * CANCEL-TIMER onbatt AT ONLINE * CANCEL-TIMER lowbatt /usr/bin/upssched-cmd: #! /bin/sh case $1 in upsgone) #logger -t upssched-cmd "The UPS has been gone for awhile" echo `date +%c` >> /etc/ups/asd.txt ;; onbatt) # /etc/ups/onbatt.sh echo `date +%c` onbatt >> /etc/ups/asd.txt ;; lowbatt) # /etc/ups/lowbatt.sh echo `date +%c` lowbatt >> /etc/ups/asd.txt ;; *) logger -t upssched-cmd "Unrecognized command: $1" ;; esac ------------------------------------- Communication with my Delta UPS is OK. It does not matter what value I'll put in MONITOR and MINSUPPLIES line. NUT not waiting for both UPS to start timer. If one of them goes OB or LB it start timer. Another thing is that that NUT can't cancel LB timer (but this is not important, I can change LB percent value on UPS and just shutdown environment later without timer). -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2274 bytes Desc: Kryptograficzna sygnatura S/MIME URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20140121/2d65041a/attachment.bin>
Charles Lepple
2014-Jan-21 13:51 UTC
[Nut-upsuser] Shutdown when both (all) UPS on battery / low battery
On Jan 21, 2014, at 8:05 AM, Rafa? Oleszek wrote:> MONITOR UPS_251 at localhost 2 monmaster password master > MONITOR UPS_252 at localhost 2 monmaster password masterI think the "2"s here should be "1". "powervalue is an integer representing the number of power supplies that the UPS feeds *on this system*." So if UPS_251 is connected to one power supply on the system running upsmon, and UPS_252 is connected to another, then each powervalue is 1.> MINSUPPLIES 2Or you could change this to 4, but that masks what is actually going on. -- Charles Lepple clepple at gmail
Charles Lepple
2014-Jan-21 13:54 UTC
[Nut-upsuser] Shutdown when both (all) UPS on battery / low battery
On Jan 21, 2014, at 8:05 AM, Rafa? Oleszek wrote:> It does not matter what value I'll put in MONITOR and MINSUPPLIES line. NUT not waiting for both UPS to start timer.Correct. You can think of upssched as operating on raw UPS status, rather than the calculated powervalue that upsmon uses to decide when to shut down. -- Charles Lepple clepple at gmail
Seemingly Similar Threads
- Shutdown when both (all) UPS on battery / low battery
- Shutdown when both (all) UPS on battery / low battery
- Shutdown when both (all) UPS on battery / low battery
- Shutdown when both (all) UPS on battery / low battery
- Shutdown when both (all) UPS on battery / low battery