[Nut-upsuser] Best practice to shutdown hosts which has not NUT via upssched

Dmitri Stepanov dstep at mail.ru
Tue Jul 12 09:08:13 UTC 2016


Hi

   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
        earlyshutdown)
                logger -t upssched-cmd "Early shutdown is started"
                /bin/sh /usr/local/sbin/shutdown-all-hosts.sh
                /usr/local/sbin/upsmon -c fsd
                ;;
esac

   shutdown-all-hosts.sh contains:
# Linux hosts
HOSTLIST="sim iogate br"
for host in $HOSTLIST
do
...
     ssh $host halt -p
...
done
# 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
Dmitri Stepanov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20160712/047e9007/attachment.html>


More information about the Nut-upsuser mailing list