[Nut-upsuser] Fwd: Windows upssched does not work

Radoslav Chovan coudysk at gmail.com
Tue Mar 10 13:48:28 GMT 2020


Hi,
I have problem with upssched on windows. Upssched is not executed. I
have 2 scripts, 1 for notification in upsmon and second for scheduling
in upssched. Monitoring is working fine, script write to log. I'm
using binary windows installer 2.6.5-6 from NUT.

Here are my configs:
--- nut.conf
MODE=netclient

--- upsmon.conf
MONITOR ups_1000 at 192.168.3.95 1 <user> <password> slave
MINSUPPLIES 1
SHUTDOWNCMD "C:\\WINDOWS\\system32\\shutdown.exe /t 600 /s /d u:6:11"
NOTIFYCMD C:\\NUT\\notify.cmd
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG C:\\NUT\\killpower
NOTIFYMSG ONLINE    "UPS %s on line power"
NOTIFYMSG ONBATT    "UPS %s on battery"
NOTIFYMSG LOWBATT    "UPS %s battery is low"
NOTIFYMSG FSD        "UPS %s: forced shutdown in progress"
NOTIFYMSG COMMOK    "Communications with UPS %s established"
NOTIFYMSG COMMBAD    "Communications with UPS %s lost"
NOTIFYMSG SHUTDOWN    "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT    "UPS %s battery needs to be replaced"
NOTIFYMSG NOCOMM    "UPS %s is unavailable"
NOTIFYMSG NOPARENT    "upsmon parent process died - shutdown impossible"
NOTIFYFLAG ONLINE    SYSLOG+EXEC
NOTIFYFLAG ONBATT    SYSLOG+EXEC
NOTIFYFLAG LOWBATT    SYSLOG+EXEC
NOTIFYFLAG FSD        SYSLOG+EXEC
NOTIFYFLAG COMMOK    SYSLOG+EXEC
NOTIFYFLAG COMMBAD    SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN    SYSLOG+EXEC
NOTIFYFLAG REPLBATT    SYSLOG+EXEC
NOTIFYFLAG NOCOMM    SYSLOG+EXEC
NOTIFYFLAG NOPARENT    SYSLOG+EXEC
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5

--- upssched.conf
CMDSCRIPT "cmd.exe /C C:\\NUT\\sched.cmd"
PIPEFN "C:\\NUT\\upssched.pipe"
LOCKFN "C:\\NUT\\upssched.lock"
AT ONBATT * EXECUTE onbattnow
AT ONBATT * START-TIMER onbattwarn 30
AT ONLINE * EXECUTE ups-back-on-line
AT ONLINE * CANCEL-TIMER onbattwarn

--- notify.cmd
@ECHO OFF
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%b.%%a.%%c)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a:%%b)
echo [%mydate%-%mytime%] %1 %2 %3 %4 >> C:\\NUT\\notify.log

--- output in notify.log
[10.03.2020-10:56 AM] "UPS ups_1000 at 192.168.3.95 on battery"
[10.03.2020-11:00 AM] C:\NUT\notify.cmd "UPS ups_1000 at 192.168.3.95 on
line power"
[10.03.2020-11:15 AM] "UPS ups_1000 at 192.168.3.95 battery is low"
[10.03.2020-12:23 PM] "UPS ups_1000 at 192.168.3.95 on battery"
[10.03.2020-12:24 PM] "UPS ups_1000 at 192.168.3.95: forced shutdown in
progress"
[10.03.2020-12:24 PM] "Auto logout and shutdown proceeding"
[10.03.2020-12:25 PM] "Communications with UPS ups_1000 at 192.168.3.95 lost"
[10.03.2020-12:25 PM] "UPS ups_1000 at 192.168.3.95 is unavailable"
[10.03.2020-12:30 PM] "UPS ups_1000 at 192.168.3.95 is unavailable"
[10.03.2020-12:35 PM] "UPS ups_1000 at 192.168.3.95 is unavailable"
[10.03.2020-12:40 PM] "UPS ups_1000 at 192.168.3.95 is unavailable"
[10.03.2020-12:45 PM] "UPS ups_1000 at 192.168.3.95 is unavailable"
[10.03.2020-12:49 PM] "UPS ups_1000 at 192.168.3.95 battery is low"
[10.03.2020-12:55 PM] "Communications with UPS ups_1000 at 192.168.3.95 lost"
[10.03.2020-12:55 PM] "Communications with UPS ups_1000 at 192.168.3.95
established"
[10.03.2020-01:04 PM] "UPS ups_1000 at 192.168.3.95 battery is low"

--- sched.cmd
@ECHO OFF
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%b.%%a.%%c)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a:%%b)
echo [%mydate%-%mytime%] %1  %2 >> C:\\NUT\\sched.log

Script sched.cmd is never executed, and I can't instruct windows
client to early shut down.

Any help ?

Thanks.
________________________________

s pozdravom
Radoslav Chovan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20200310/a5f7427b/attachment.html>


More information about the Nut-upsuser mailing list