[Nut-upsuser] NUT Windows port questions
dns-srv at yandex.ru
Wed Jan 4 20:26:50 UTC 2012
Hello NUT Team!
I've got some questions about NUT (Windows port), which I couldn't resolve
I have a test environment that contains:
1. NUT network server (OS: Debian 6.0.3, x64, NUT 2.4.3)
2. Linux clients (OS: different, NUT 2.4.3, 2.6.1)
3. Windows clients (OS: Windows Standard Server Core 2008 R1 SP1, Windows 7
x64 Ultimate SP1, NUT-Installer-2.6.1-1.msi)
4. APC Back-UPS ES 550 connected to network server
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...
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 =):
MODE = netclient
MONITOR mainups at 192.168.10.2 1 monuser secret slave MINSUPPLIES 1
SHUTDOWNCMD "shutdown.exe -s -t 0 -c \"Bla-bla-bla.\""
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
password = 123qweASD
password = secret
In this configuration, I can see UPS variables, Windows Server is shutting
down on "upsmon -c fsd".
upsc mainups at 192.168.10.2
device.mfr: American Power Conversion
device.model: Back-UPS ES 525
1. It seems that it is 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).
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
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 mainups at 192.168.10.2 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.
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 have I problem in my configs or something else?
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 behavior 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.".
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.
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
The main question: is there someone who has success with timers on Windows
x64 platform? I would like to use them...
With the best wishes,
More information about the Nut-upsuser