<div>Hello NUT Team!</div><div>š</div><div>I've got some questions about NUT (Windows port), which I couldn't resolve by myself.</div><div>š</div><div>I have aštest environment that contains:</div><div>1. NUT network server (OS: Debian 6.0.3, x64, NUT 2.4.3)</div><div>2. Linux clients (OS: different, NUT 2.4.3, 2.6.1)</div><div>3. Windows clients (OS: Windows Standard Server Core 2008 R1 SP1, Windows 7 x64 Ultimate SP1, NUT-Installer-2.6.1-1.msi)</div><div>4. APC Back-UPS ES 550 connected to network server</div><div>š</div><div>Currently, network server and Linux clientsšare working well. I can see UPS variables via "upsc" (server/clients), can shutdown slaves and masters via "upsmon -c fsd", no problem with timers andšearly shutdown script, etc...</div><div>š</div><div>Now, I am trying to set the same configurationšon Windows Server asšon Linux clients and have no success. I use the following configuration (don't carry about credentials =):</div><div>š</div><div>nut.conf</div><div>MODE = netclient</div><div>š</div><div>upsmon.conf</div><div>RUN_AS_USER user</div><div>MONITOR <a href="mailto:mainups@192.168.10.2">mainups@192.168.10.2</a> 1 monuser secret slave</div><div>MINSUPPLIES 1</div><div>SHUTDOWNCMD "shutdown.exe -s -t 0 -c \"Bla-bla-bla.\""</div><div>NOTIFYCMD upssched.exe</div><div>POLLFREQ 5</div><div>POLLFREQALERT 5</div><div>HOSTSYNC 15</div><div>DEADTIME 15</div><div>POWERDOWNFLAG "C:\\killpower.flag"</div><div>NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC<br />NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC<br />RBWARNTIME 43200</div><div>NOCOMMWARNTIME 300</div><div>FINALDELAY 5</div><div>š</div><div>upsd.users</div><div>[user]<br />password = 123qweASD</div><div>[mainups]<br />password = secret<br />upsmon slave</div><div>upssched.conf</div><div>CMDSCRIPT upsscript.cmd</div><div>PIPEFN C:\\NUT\\NUT\\upssched.pipe</div><div>LOCKFN C:\\NUT\\NUT\\upssched.lock</div><div>...</div><div>š</div><div>In this configuration, I can see UPS variables, Windows Server is shutting down on "upsmon -c fsd".</div><div>š</div><div>For example:</div><div>upsc <a href="mailto:mainups@192.168.10.2">mainups@192.168.10.2</a></div><div>battery.charge: 100<br />battery.charge.low: 10<br />battery.charge.warning: 50<br />battery.date: 2011/12/30<br />battery.mfr.date: 2011/12/30<br />battery.runtime: 6675<br />battery.runtime.low: 120<br />battery.type: PbAc<br />battery.voltage: 13.5<br />battery.voltage.nominal: 12.0<br />device.mfr: American Power Conversion<br />device.model: Back-UPS ES 525</div><div>...</div><div>š</div><div>1. It seems that it impossible to use long file names with spaces in PIPEFN/LOCKFN/NOTIFYCMD/... (like "C:\Program Files (x86)\NUT\sbin\upssched.exe") or I couldn't find the way (error: cannot find "C:\Program "). Environment variables are not supported too (it would be great to use %ProgramFiles% in the paths).</div><div>š</div><div>This problem is the reason, why I had to use "C:\NUT\NUT" directory for pipe & lock. Moreover, to start "upssched.exe" via NOTIFYCMD, I included "C:\Program Files (x86)\NUT\bin" and "C:\Program Files (x86)\NUT\sbin" into %PATH% variable.</div><div>š</div><div>2. I added line "AT ONBATT * EXECUTE Dennis" into end of "upssched.conf". Then "mainups" is going to battery, NUT writes proper event into Application Log: "upsmon - UPS <a href="mailto:mainups@192.168.10.2">mainups@192.168.10.2</a> on battery.".šIt is OK, but strange thing is that the script "upsscript.cmd" was not executed. I have checked it several times (even using Process Monitor from sysinternals - process "upssched.exe" is not started at all). The next interesting thing: I started "upsmon -DDD" and ... at the next battery event, "upssched.exe" was executed and "upsscript.cmd" has been executed too.</div><div>š</div><div>By default, there are "nut.exe" and one "upsmon.exe" processes in Windows Server (after its starting). There are two "upsmon" in Linux client. It is correct situation? Should I start one more instance of "upsmon" to execute CMDSCRIPT successfully or I have a problem in my configs oor something else?</div><div>š</div><div>3. I have tried to use timers. If remove previous line from "upssched.conf" and add "AT ONBATT * START-TIMER onbattwarn 3", "AT ONLINE * CANCEL-TIMER onbattwarn", the behaviour will be like in previous item: no running "upssched.exe" without second instance of "upsmon", but with additional effects =). "upssched.exe" is starting, "upssched.lock" file is created, then process is terminated with event "upssched.exe - Failed to connect to parent and failed to create parent: Permission denied.".</div><div>š</div><div>I couldn't fix this problem =(. I've checked the permissions, user's accounts for all NUT processes/FS/etc. It seems that everything is OK. I think that the problem is in get_lock function in "upssched.c". No ideas why, anyway, GetLastError returns "permission denied" strongly.</div><div>š</div><div>4. A few times, I've got error "upssched.exe - open /dev/null: No such file or directory." during my experiments, but I have no idea how to reproduce it =(</div><div>š</div><div>The main question: is there someone who has success with timers on Windows x64 platform? I would like to use them...</div><div>š</div><div>Thanks!</div><div>š</div><div>š</div><div>With the best wishes,</div><div>Dennis</div>