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

Dmitri Stepanov dstep at mail.ru
Thu Jul 14 12:18:48 UTC 2016

Thank you Roger

 Среда, 13 июля 2016, 15:22 +03:00 от Roger Price <roger at rogerprice.org>:
>On Wed, 13 Jul 2016, Dmitri Stepanov wrote:
>>>>    shutdown-all-hosts.sh contains:
>>>> # Linux hosts
>>>> HOSTLIST="sim iogate br"
>>>> for host in $HOSTLIST
>>>> do
>>>> ...
>>>>      ssh $host halt -p
>>>> ...
>>>> done
>>>>    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
>>> When you say "it does not work", what are the symptoms? Does 
>>> shutdown-all-hosts.sh get called?
>> System has installed far away (in China) and there is bad Internet 
>> connection, so I might have ability to connect and check log files in a 
>> few day or weeks. Now I know exactly only that NUTed hosts shutdown via 
>> NUT as expected and no one host listed in shutdown-all-hosts.sh script 
>> don't.
>> Roger, I would appreciate if you give me a hint how to "reproduce the 
>> NUT protocol ... ". Do you mean getting feedback to CMDSCRIPT about the 
>> "no NUTed" slaves indeed shutting down and/or some timing in NUT config 
>> files...?
>Without knowing the details of your system architecture, it looks as if 
>your system is very different from the typical case for which NUT is 
>intended.  I'm assuming that your with-NUT machine is far away from the 
>"slaves" with an unreliable connection.  In this case the "slaves" will 
>have to be autonomous and decide for themselves if and when they shut 
>down.  I notice that you set up the SSH connection only when you want to 
>remotely order a slave shutdown.  Perhaps in your case it would be better 
>to have the ssh link open all the time with a periodic "heartbeat" between 
>the no-NUT slaves and the master-with-NUT. In other words, sim, iogate and 
>br behave as masters, not slaves.

All the hosts are installed together in one rack and have fed from one UPS (only I am remote from the system  :) and I haven't ability to connect to it. Some of hosts haven't NUT for a number of reasons. I don't need to inform not-NUT hosts about any UPS events, heartbeat, etc... but only shutdown all the hosts after upssched timer expired. Because script shutdown-all-hosts.sh works fine (there is no ssh problem) if it's been run by hand but don't work from CMDSCRIPT - I thought that I miss something "at the NUT side".

>> It is not good to shutdown from CMDSCRIPT the master itself. Is it correct?
>If the no-NUT machines were autonomous, then NUT is in charge of just the 
>with-NUT machine, and there is no problem with shutting down from the 
>Could you build a local version of your setup for testing?

Yes I've thought about it. I'd build the model of the system locally.

>Nut-upsuser mailing list
>Nut-upsuser at lists.alioth.debian.org

More information about the Nut-upsuser mailing list