<HTML><BODY><div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
        <div>
                <base target="_self" href="https://e.mail.ru/">
                
            <div id="style_14685719450000000384_BODY">
<div>
        
        <div>>Четверг, 14 июля 2016, 23:58 +03:00 от Roger Price <<a href="mailto:roger@rogerprice.org">roger@rogerprice.org</a>>:<br><div>
><br>
>On Thu, 14 Jul 2016, Dmitri Stepanov wrote:<br>
><br>
>> Some of those hosts haven't NUT including upsmon (and other software <br>
>> which is not included by suppliers of the hosts) for a number of <br>
>> reasons. I don't need to inform not-NUT hosts about any UPS events, <br>
>> etc... but only shutdown all the hosts after upssched timer expired. So <br>
>> I think shutdown them via ssh would be enough and creating some <br>
>> replacement for upsmon is too much.<br>
><br>
>Perhaps it is possible to have a micro upsmon in the form of a cron job in <br>
>every slave which, every minute, runs something like<br>
><br>
>  rprice@maria:~> X=$( echo "GET VAR my-ups battery.charge" | netcat -w1 upsd-server 3493 )<br>
>  rprice@maria:~> if [[ "$X" =~ \"([0-9]*)\" ]] ; then Y=${BASH_REMATCH[1]}; else Y=999 ; fi<br>
>  rprice@maria:~> if [[ "$Y" -gt 35 ]] ; then echo "Carry on $Y" ; else echo "Shutdown $Y" ; fi<br>
>  Carry on 100<br>
><br>
>Different slaves could have different low battery values. I'm sure that a <br>
>netcat expert would be able to find a way of executing netcat only once.<br>
<br>
Cool. I've never think via this way. I'm sure I'll use it. Thank you for the hint.<br>But a problem could be with netcat software (if it installed or not on the not-NUT slaves, moreover there are a number of Windows hosts). Unfortunately I have no ability to break in configuration and installed software of the not-NUT hosts too deeply (licenses of the suppliers of the hosts, etc...).<br><br>Thanks to Kris Jordan, I guess the problem is the uid of the upssched (CMDSCRIPT and my shutdown script and ssh) process. I hope I 'd check it as soon as I get connection to the system.<br><br>
><br>
>Roger<br>
><br>
>_______________________________________________<br>
>Nut-upsuser mailing list<br>
><a href="mailto:Nut-upsuser@lists.alioth.debian.org">Nut-upsuser@lists.alioth.debian.org</a><br>
><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
<br>
</div>
            
        
                
        </div>

        
</div>
</div>
            
        
                <base target="_self" href="https://e.mail.ru/">
        </div>

        
</div></BODY></HTML>