Denis Serov
2012-Sep-13 19:19 UTC
[Nut-upsuser] Early shutdowns and 2.6.5-1 package for Windows
Hello NUT Team! I am testing the early shutdowns in NUT 2.6.5-1 package for Windows (Windows 7 x64). My configuration files: upsmon.conf RUN_AS_USER upsmon MONITOR upsa at 192.168.10.200 1 upsmon pass master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" NOTIFYCMD "upssched.exe" POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG "C:\\NUT\\killpower" NOTIFYMSG COMMOK "Communications with UPS %s established" NOTIFYMSG COMMBAD "Communications with UPS %s lost" NOTIFYFLAG COMMOK SYSLOG+EXEC+WALL NOTIFYFLAG COMMBAD SYSLOG+EXEC+WALL RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5 upssched.conf CMDSCRIPT "cmd.exe -C C:\\NUT\\1.cmd" PIPEFN "C:\\NUT\\pipefn.lock" LOCKFN "C:\\NUT\\lockfn.lock" AT COMMBAD upsa at 192.168.10.200 START-TIMER upslost 10 AT COMMOK upsa at 192.168.10.200 CANCEL-TIMER upslost 1.cmd echo %1 > 1.txt I have found some issues I would like to report. 1. NOTIFYCMD parameter is not specified NUT doesn't start UPSSCHED tool (as I remember, Linux version do it by default). 2. PIPEFN parameter is invalid (its value is a file in non-existed directory) UPSMON logs an error: 25.222443 pollups: upsa at 192.168.10.200 25.229443 get_var: upsa at 192.168.10.200 / status 25.238444 Poll UPS [upsa at 192.168.10.200] failed - Data stale 25.248444 Current power value: 1 25.254444 Minimum power value: 1 Failed to connect to parent and failed to create parent: No error [The system cannot find the path specified. ] There is no proper record in Event Viewer. 2.6.0-1 version writes different warnings and errors there. They helps to understand what is wrong. That is quite difficult now because of total silence. 3. All parameters are valid Two instances of UPSSCHED.EXE are starting (why two?) and they are not stopping (I was waiting about 5 minutes). CMDSCRIPT is not executed, I cannot find its activity. Moreover, these processes are not stopped when Network UPS Tools service is stopped. UPSMON outputs a lot of strings like "read confirmation failed, trying again", "addchar: discarding invalid character (0x00)!" 40.276304 pollups: upsa at 192.168.10.200 40.281304 get_var: upsa at 192.168.10.200 / status 40.289305 Poll UPS [upsa at 192.168.10.200] failed - Data stale 40.298305 Current power value: 1 40.303305 Minimum power value: 1 read confirmation failed, trying again read confirmation got [] read confirmation failed, trying again 45.307592 pollups: upsa at 192.168.10.200 45.312592 get_var: upsa at 192.168.10.200 / status 45.319592 Poll UPS [upsa at 192.168.10.200] failed - Data stale 45.328593 Current power value: 1 45.333593 Minimum power value: 1 read confirmation failed, trying again read confirmation failed, trying again read confirmation failed, trying again read confirmation got [] Timer daemon started addchar: discarding invalid character (0x00)! addchar: discarding invalid character (0x00)! Sometimes I see the strings with garbage inside, like repeated using of released memory. Thanks, Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20120913/eab8052e/attachment.html>
FredericBohe at Eaton.com
2012-Sep-14 13:43 UTC
[Nut-upsuser] Early shutdowns and 2.6.5-1 package for Windows
?> From: nut-upsuser-bounces+fredericbohe=eaton.com at lists.alioth.debian.org [nut-upsuser-bounces+fredericbohe=eaton.com at lists.alioth.debian.org] on behalf of Denis Serov [dns-srv at yandex.ru]> Sent: Thursday, September 13, 2012 9:19 PM > To: nut-upsuser at lists.alioth.debian.org > Subject: [Nut-upsuser] Early shutdowns and 2.6.5-1 package for Windows > > Hello NUT Team!Hello Denis,> > I am testing the early shutdowns in NUT 2.6.5-1 package for Windows (Windows 7 x64). > > My configuration files: > > upsmon.conf > RUN_AS_USER upsmon > MONITOR upsa at 192.168.10.200 1 upsmon pass master > MINSUPPLIES 1 > SHUTDOWNCMD "/sbin/shutdown -h +0" > NOTIFYCMD "upssched.exe" > POLLFREQ 5 > POLLFREQALERT 5 > HOSTSYNC 15 > DEADTIME 15 > POWERDOWNFLAG "C:\\NUT\\killpower" > NOTIFYMSG COMMOK "Communications with UPS %s established" > NOTIFYMSG COMMBAD "Communications with UPS %s lost" > NOTIFYFLAG COMMOK SYSLOG+EXEC+WALL > NOTIFYFLAG COMMBAD SYSLOG+EXEC+WALL > RBWARNTIME 43200 > NOCOMMWARNTIME 300 > FINALDELAY 5 > > upssched.conf > CMDSCRIPT "cmd.exe -C C:\\NUT\\1.cmd"I guess it's /C (not -C).> PIPEFN "C:\\NUT\\pipefn.lock" > LOCKFN "C:\\NUT\\lockfn.lock" > AT COMMBAD upsa at 192.168.10.200 START-TIMER upslost 10 > AT COMMOK upsa at 192.168.10.200 CANCEL-TIMER upslost > > 1.cmd > echo %1 > 1.txt > > I have found some issues I would like to report. > > 1. NOTIFYCMD parameter is not specified > NUT doesn?t start UPSSCHED tool (as I remember, Linux version do it by default).upssched is called by upsmon when a NOTIFYFLAG set to EXEC happens. It is not started by NUT service (even on Linux).> > 2. PIPEFN parameter is invalid (its value is a file in non-existed directory) > UPSMON logs an error: > 25.222443 pollups: upsa at 192.168.10.200 > 25.229443 get_var: upsa at 192.168.10.200 / status > 25.238444 Poll UPS [upsa at 192.168.10.200] failed - Data stale > 25.248444 Current power value: 1 > 25.254444 Minimum power value: 1 > Failed to connect to parent and failed to create parent: No error [The system cannot find the path specified. ]In fact PIPEFN is ignored on Windows version, anyway you still must have something (anything) set for it.> > There is no proper record in Event Viewer. 2.6.0-1 version writes different warnings and errors there. They helps to understand what is wrong. > That is quite difficult now because of total silence. > > 3. All parameters are valid > Two instances of UPSSCHED.EXE are starting (why two?) and they are not stopping (I was waiting about 5 minutes). CMDSCRIPT is not executed, I cannot find its activity. > Moreover, these processes are not stopped when Network UPS Tools service is stopped. > > UPSMON outputs a lot of strings like ?read confirmation failed, trying again?, ?addchar: discarding invalid character (0x00)!? > > 40.276304 pollups: upsa at 192.168.10.200 > 40.281304 get_var: upsa at 192.168.10.200 / status > 40.289305 Poll UPS [upsa at 192.168.10.200] failed - Data stale > 40.298305 Current power value: 1 > 40.303305 Minimum power value: 1 > read confirmation failed, trying again > read confirmation got [] > read confirmation failed, trying again > 45.307592 pollups: upsa at 192.168.10.200 > 45.312592 get_var: upsa at 192.168.10.200 / status > 45.319592 Poll UPS [upsa at 192.168.10.200] failed - Data stale > 45.328593 Current power value: 1 > 45.333593 Minimum power value: 1 > read confirmation failed, trying again > read confirmation failed, trying again > read confirmation failed, trying again > read confirmation got [] > Timer daemon started > addchar: discarding invalid character (0x00)! > addchar: discarding invalid character (0x00)! > > Sometimes I see the strings with garbage inside, like repeated using of released memory.Good point Denis. There is a regression on Windows version. It is related to a security issue fixed a while ago. Some Linux modifications did not make it to Windows code. Can you try this binary : fbohe.free.fr/upssched.exe Let us know if this fix your issue.> > Thanks, > DenisThank you for your usefull bug report. Fred -- Eaton Opensource Team - http://opensource.eaton.com ----------------------------- -----------------------------
Denis Serov
2012-Sep-15 13:23 UTC
[Nut-upsuser] Early shutdowns and 2.6.5-1 package for Windows
Hello Frederic!>> upssched.conf >> CMDSCRIPT "cmd.exe -C C:\\NUT\\1.cmd"> I guess it's /C (not -C).That is my misprint, slash is presented in original config file ;)>> 1. NOTIFYCMD parameter is not specified NUT doesn?t start UPSSCHED >> tool (as I remember, Linux version do it by default).> upssched is called by upsmon when a NOTIFYFLAG set to EXEC happens. It is not started by NUT service (even on Linux).I thought about "NUT" as product, certainly, UPSMON executes UPSSCHED =) But my original worry was wrong, Linux version does not start UPSSCHED as default tool too (if NOTIFYCMD parameter is not specified). Sorry for misconception.>> Failed to connect to parent and failed to create parent: No error >> [The system cannot find the path specified. ]> In fact PIPEFN is ignored on Windows version, anyway you still must have something (anything) set for it.>> There is no proper record in Event Viewer. 2.6.0-1 version writes different warnings and errors there. They helps to understand what is wrong. >> That is quite difficult now because of total silence.Well, I have meant something else. I sent a screenshot to you. You will find a lot of records which has been created by 2.6.0-1 version. Non-existing PIPEFN property was just a test to raise an error. Version 2.6.5-1 does not write to Windows Event Log anything except notifications about starting/stopping service/upsd/upsmon. That is not useful for troubleshooting.>> got [] Timer daemon started >> addchar: discarding invalid character (0x00)! >> addchar: discarding invalid character (0x00)!>> Sometimes I see the strings with garbage inside, like repeated using of released memory.> Good point Denis. > There is a regression on Windows version. It is related to a security issue fixed a while ago. Some Linux modifications did not make it to Windows code. > Can you try this binary :> fbohe.free.fr/upssched.exe> Let us know if this fix your issue.I have very good news: the early shutdowns are working properly. Only one instance of UPSSCHED (for my configuration) is started and stopped, no errors like "read confirmation failed, trying again read confirmation failed" and CMDSCRIPT is executed. Here is UPSMON output: 15.153257 do_notify: ntype 0x0005 (COMMBAD) 15.168857 Communications with UPS upsa at 192.168.10.200 lost 15.168857 Current power value: 1 15.184457 Minimum power value: 1 Timer daemon started New timer: upslost (2 seconds) New timer: upslost (2 seconds) Event: upslost C:\NUT>echo upslost 1>C:\NUT\1.txt Execute command "cmd.exe /C C:\NUT\1.cmd upslost" OK Event: upslost C:\NUT>echo upslost 1>C:\NUT\1.txt Execute command "cmd.exe /C C:\NUT\1.cmd upslost" OK 20.198341 pollups: upsa at 192.168.10.200 20.198341 get_var: upsa at 192.168.10.200 / status Excellent! Thank you very much, Denis