[Nut-upsuser] "upsmon -c fsd" cause system shutdown

d tbsky tbskyd at gmail.com
Tue Sep 15 02:53:39 UTC 2015


2015-09-15 10:38 GMT+08:00 Charles Lepple <clepple at gmail.com>:
> I haven't used PyNUT much, so I am not sure how you would do that.
>
> If you want to simulate a power failure on only one UPS, I still recommend using the dummy-ups driver reading from a file. You can then set "ups.status: OB LB" on each simulated UPS.
>

 sorry I forgot reply all..
 I don't know about dummy-ups, that seems interesting and useful when
testing.  but my issue is not about testing it is real world case.
 the python script like below so I can now doing early shutdown in
"big-server" environment:


#!/usr/bin/env python

import PyNUT
import sys

if __name__ == "__main__" :

    nut = PyNUT.PyNUTClient(login="monmaster", password="passmaster")
    try :
        result = nut.FSD( "myups")
    except :
        result = sys.exc_info()[1]
        print( "\033[01;33m%s\033[0m\n" % result )
        exit(1)


Regards,
tbskyd



More information about the Nut-upsuser mailing list