Herwarth Heitmann
2008-Dec-15 12:07 UTC
[Nut-upsuser] ubuntu 8.04 upssched CANCEL-TIMER ignored
hello,
every two weeks my system shutsdown because my apc ups does a self
test and nut is not picking up the cancel timer event.
according to me all settings are correct. in my upssched-cmd script i
execute a remote shutdown, because nut is running in a virtual machine
and i want the script to shutdown all hosts in my esx environment.
my upssched-cmd script
----
#!/bin/sh
# !! COPY THIS FILE TO /USR/SBIN/UPSSCHED-CMD !!
LOGGER=/usr/bin/logger
WALL=/usr/bin/wall
UPSMON=/sbin/upsmon
case $1 in
onbatt)
$LOGGER -t upssched-cmd "The UPS has been on battery for awhile"
echo "The UPS has been on battery for a while, logout right now!" |
$WALL
;;
shutdown)
$LOGGER -t upssched-cmd "UPS on battery too long, shutdown
all virtual machines on ESX host"
# /usr/bin/ssh root at 192.168.1.2 '/usr/bin/nohup /root/shutdown.sh > /
root/shutdown.log &' &
;;
offbatt)
$LOGGER -t upssched-cmd "The UPS is online again"
echo "The UPS is online again" | $WALL
;;
*)
$LOGGER -t upssched-cmd "ERROR!! $0 doesn't support $1"
;;
esac
-----
my upssched.conf
-----
CMDSCRIPT /usr/sbin/upssched-cmd
LOCKFN /var/lib/nut/upssched.lock
PIPEFN /var/lib/nut/upssched.pipe
AT ONBATT * START-TIMER shutdown 90
AT ONLINE * CANCEL-TIMER shutdown offbatt
----
my logfile daemon.log:
Dec 15 13:01:43 helux-ups upsmon[5366]: UPS apc at localhost on battery
Dec 15 13:01:43 helux-ups upssched[5385]: Timer daemon started
Dec 15 13:01:44 helux-ups upssched[5385]: New timer: shutdown (90
seconds)
Dec 15 13:01:48 helux-ups upsmon[5366]: UPS apc at localhost on line power
Dec 15 13:03:14 helux-ups upssched[5385]: Event: shutdown
Dec 15 13:03:29 helux-ups upssched[5385]: Timer queue empty, exiting
----
so the timer is never cancelled.....
please help
Arjen de Korte
2008-Dec-15 12:31 UTC
[Nut-upsuser] ubuntu 8.04 upssched CANCEL-TIMER ignored
Citeren Herwarth Heitmann <herwarth at heitmann.nl>:> every two weeks my system shutsdown because my apc ups does a self > test and nut is not picking up the cancel timer event.Do you have the EXEC flag set on the ONLINE event in 'upsmon.conf'?> according to me all settings are correct. in my upssched-cmd script i > execute a remote shutdown, because nut is running in a virtual machine > and i want the script to shutdown all hosts in my esx environment.It usually helps if you mention which NUT version you're using. I don't have a clue which is shipped with Ubuntu 8.04 (and you may not be using their packaged version anyway). Since upsmon clearly sees the ONLINE event, we can rule out driver problems. I'm wondering where the logger output went by the way, it would be useful to see that. Best regards, Arjen -- Please keep list traffic on the list
Possibly Parallel Threads
- samba server only accessiblie via ip address and notviadns name
- wrong NOTIFYTYPE always ONBATT on upssched TIMER ?
- upssched does not start the script when timer triggers
- wrong NOTIFYTYPE always ONBATT on upssched TIMER ?
- upssched timer configuration with redundant UPSes ?