Roger Price
2016-Jul-13 12:22 UTC
[Nut-upsuser] Best practice to shutdown hosts which has not NUT via upssched
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.> 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 CMDSCRIPT. Could you build a local version of your setup for testing? Roger
Dmitri Stepanov
2016-Jul-14 12:18 UTC
[Nut-upsuser] Best practice to shutdown hosts which has not NUT via upssched
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 >CMDSCRIPT. > >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.> >Roger >_______________________________________________ >Nut-upsuser mailing list >Nut-upsuser at lists.alioth.debian.org >http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Kris Jordan
2016-Jul-14 22:54 UTC
[Nut-upsuser] Best practice to shutdown hosts which has not NUT via upssched
Dmitri Stepanov wrote on 7/14/2016 5:18 AM:> 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".I do something similar, I don't want inbound connections (DMZ --> LAN), so I use SSH. SSH environment difference (e.g. SSH agent forwarding)? That could explain why it works manually, but not when unattended (upssched). I specifically set SSH_AUTH_SOCK="" in my shutdown script so it won't affect my testing when running the script by hand. I use ssh -i <password-less identity file> for each host to shut down.
Maybe Matching Threads
- Best practice to shutdown hosts which has not NUT via upssched
- Best practice to shutdown hosts which has not NUT via upssched
- Best practice to shutdown hosts which has not NUT via upssched
- Best practice to shutdown hosts which has not NUT via upssched
- Best practice to shutdown hosts which has not NUT via upssched