P.S.2 Today I experienced something weird. As I was working, the system started a shutdown and did shut down, then the UPS got powered off and then back on - an expected behavior for a power fail situation. However there was no power failure! I ran nut-journal to check what happened: Previous complete boot through shutdown Oct 29 10:09:33 i7 upsdrvctl[1966]: Using subdriver: MGE HID 1.32 Oct 29 10:09:34 i7 upsdrvctl[1966]: Network UPS Tools - Generic HID driver 0.38 (2.7.1) Oct 29 10:09:34 i7 upsdrvctl[1966]: USB communication driver 0.32 Oct 29 10:09:35 i7 upsdrvctl[1966]: Network UPS Tools - UPS driver controller 2.7.1 Oct 29 10:09:35 i7 upsd[2235]: fopen /var/lib/ups/upsd.pid: No such file or directory Oct 29 10:09:35 i7 upsd[2235]: listening on ::1 port 3493 Oct 29 10:09:35 i7 upsd[2235]: listening on ::1 port 3493 Oct 29 10:09:35 i7 upsd[2235]: listening on 127.0.0.1 port 3493 Oct 29 10:09:35 i7 upsd[2235]: Connected to UPS [myups]: usbhid-ups-myups Oct 29 10:09:35 i7 upsd[2235]: listening on 127.0.0.1 port 3493 Oct 29 10:09:35 i7 upsd[2235]: Connected to UPS [myups]: usbhid-ups-myups Oct 29 10:09:35 i7 upsd[2236]: Startup successful Oct 29 10:09:35 i7 upsmon[2237]: fopen /var/run/upsmon.pid: No such file or directory Oct 29 10:09:35 i7 upsmon[2237]: UPS: myups at localhost (master) (power value 1) Oct 29 10:09:35 i7 upsmon[2237]: Using power down flag file /etc/ups/killpower Oct 29 10:09:35 i7 upsmon[2238]: Startup successful Oct 29 10:09:35 i7 upsd[2236]: User upsmaster@::1 logged into UPS [myups] Oct 29 10:46:46 i7 upsmon[2239]: UPS myups at localhost battery is low Oct 29 10:46:46 i7 upssched[3581]: Executing command: ups-low-battery Oct 29 10:46:46 i7 upssched-cmd[3583]: Calling upssched-cmd ups-low-battery Oct 29 10:46:46 i7 upssched-cmd[3584]: Unrecognized command: ups-low-battery Oct 29 10:46:46 i7 upssched[3585]: Timer daemon started Oct 29 10:46:46 i7 upssched[3585]: New timer: shutdown-timer (35 seconds) Oct 29 10:47:21 i7 upssched[3585]: Event: shutdown-timer Oct 29 10:47:21 i7 upssched-cmd[3593]: Calling upssched-cmd shutdown-timer Oct 29 10:47:21 i7 upssched-cmd[3594]: Shutdown timer reached: Calling upsmon -c fsd Oct 29 10:47:21 i7 upsmon[2239]: Signal 10: User requested FSD Oct 29 10:47:21 i7 upsd[2236]: Client upsmaster@::1 set FSD on UPS [myups] Oct 29 10:47:21 i7 upsmon[2239]: Executing automatic power-fail shutdown Oct 29 10:47:21 i7 upsmon[2239]: Auto logout and shutdown proceeding Oct 29 10:47:26 i7 upsmon.conf[3602]: SHUTDOWNCMD calling /sbin/shutdown to shut down system Oct 29 10:47:26 i7 upsd[2236]: mainloop: Interrupted system call Oct 29 10:47:26 i7 upsd[2236]: Signal 15: exiting Oct 29 10:47:26 i7 upsdrvctl[3651]: Network UPS Tools - UPS driver controller 2.7.1 Oct 29 10:47:32 i7 systemd-journal[523]: Journal stopped It seems NUT has executed a shutdown because of low battery. However the battery was at 100% before shutdown and right after boot. I suspect this is just another case of those false positive alarms (disconnects/reconnects) which happen randomly and are also sometimes accompanied by messages for low battery (instantly followed by a message of battery ok). So I removed the +EXEC on certain lines in upsmon.conf: NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG LOWBATT SYSLOG+WALL NOTIFYFLAG FSD SYSLOG+WALL+EXEC NOTIFYFLAG COMMOK SYSLOG+WALL NOTIFYFLAG COMMBAD SYSLOG+WALL NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC NOTIFYFLAG REPLBATT SYSLOG+WALL NOTIFYFLAG NOCOMM SYSLOG+WALL NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC Can you confirm if that is enough as a measure not to initiate shutdown on low battery without actual power failure? Also - what would be the proper config to *execute* a shutdown if there is a low battery but *only* when there is an actual power failure situation (i.e. the UPS is running on battery power)? [I suppose that might work for the "optimistic" setup] --- George -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20151029/ca14a48b/attachment.html>
On Thu, 29 Oct 2015, George Anchev wrote:> Today I experienced something weird. As I was working, the system > started a shutdown and did shut down, then the UPS got powered off and > then back on - an expected behavior for a power fail situation. However > there was no power failure!...> Oct 29 10:46:46 i7 upsmon[2239]: UPS myups at localhost battery is low > Oct 29 10:46:46 i7 upssched[3581]: Executing command: ups-low-battery > Oct 29 10:46:46 i7 upssched-cmd[3583]: Calling upssched-cmd ups-low-battery > Oct 29 10:46:46 i7 upssched-cmd[3584]: Unrecognized command: ups-low-battery > Oct 29 10:46:46 i7 upssched[3585]: Timer daemon started > Oct 29 10:46:46 i7 upssched[3585]: New timer: shutdown-timer (35 seconds) > Oct 29 10:47:21 i7 upssched[3585]: Event: shutdown-timer > Oct 29 10:47:21 i7 upssched-cmd[3593]: Calling upssched-cmd shutdown-timer > Oct 29 10:47:21 i7 upssched-cmd[3594]: Shutdown timer reached: Calling upsmon -c fsd...> It seems NUT has executed a shutdown because of low battery. However the > battery was at 100% before shutdown and right after boot. I suspect this > is just another case of those false positive alarms > (disconnects/reconnects) which happen randomly and are also sometimes > accompanied by messages for low battery (instantly followed by a message > of battery ok). So I removed the +EXEC on certain lines in upsmon.conf: > > NOTIFYFLAG ONLINE ? ? ? SYSLOG+WALL+EXEC > NOTIFYFLAG ONBATT ? ? ? SYSLOG+WALL+EXEC > NOTIFYFLAG LOWBATT ? ? ?SYSLOG+WALL > NOTIFYFLAG FSD ?SYSLOG+WALL+EXEC > NOTIFYFLAG COMMOK ? ? ? SYSLOG+WALL > NOTIFYFLAG COMMBAD ? ? ?SYSLOG+WALL > NOTIFYFLAG SHUTDOWN ? ? SYSLOG+WALL+EXEC > NOTIFYFLAG REPLBATT ? ? SYSLOG+WALL > NOTIFYFLAG NOCOMM ? ? ? SYSLOG+WALL > NOTIFYFLAG NOPARENT ? ? SYSLOG+WALL+EXEC > > Can you confirm if that is enough as a measure not to initiate shutdown > on low battery without actual power failure?I had exactly the same thing two days ago with an MGE Ellipse 1500 in which I had changed the batteries. Its clear that the script upssched-cmd should check the real battery charge before shutting anything down. I'll look at this, but it will be next week at the earliest. Meantime your change to the NOTIFYFLAGs is a good fix.> Also - what would be the proper config to *execute* a shutdown if there > is a low battery but *only* when there is an actual power failure > situation (i.e. the UPS is running on battery power)? [I suppose that > might work for the "optimistic" setup]At present I don't have an example, perhaps others could advise you. Roger
> > I'll look at this, but it will be next week at the earliest.Great! Could you please notify when you do it? Meantime your change to the NOTIFYFLAGs is a good fix. Thanks. At present I don't have an example, perhaps others could advise you. I hope. --- George -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20151029/e6fc6a7e/attachment.html>