[Nut-upsuser] Best practice to shutdown hosts which has not NUT via upssched
dstep at mail.ru
Wed Jul 13 08:17:24 UTC 2016
I need to shutdown a number of hosts which has not NUT from one which has it.
I tried to do it from upssched script (after upssched's timer) like this:
case $1 in
logger -t upssched-cmd "Early shutdown is started"
/usr/local/sbin/upsmon -c fsd
# Linux hosts
HOSTLIST="sim iogate br"
for host in $HOSTLIST
ssh $host halt -p
# Windows hosts
ssh shut at com "shutdown -s -t 0"
shutdown-all-hosts.sh works fine if it runned manually.
But it does not work even if I insert sleep 30 sec before upsmon -c fsd
Also I read somewhere that it is not a good idea to shutdown other hosts from the CMDSCRIPT.
Does anyone know how to shutdown hosts without NUT from a host with NUT?
Thanks in advance
More information about the Nut-upsuser