2015-09-15 10:38 GMT+08:00 Charles Lepple <[email protected]>:
> 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

_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to