hi: my testing server has two power supply and attach to two ups. one of the ups is connect to the server with usb. my upsmon.conf like below: # for two ups MONITOR ftups at localhost 1 monmaster nutmaster master MONITOR ftups at 10.1.1.2 1 monslave nutslave slave MINSUPPLIES 1 # for early shutdown NOTIFYFLAG ONBATT EXEC+WALL+SYSLOG NOTIFYFLAG ONLINE EXEC+WALL+SYSLOG NOTIFYCMD /usr/sbin/upssched the early shutdown script use "upsmon -c fsd" to set FSD to master ups. but when testing, the "upsmon -c fsd" not only set FSD to ups, it also create /etc/killpower and run SHUTDOWNCMD and terminate itself, although I have a live second ups connection. I wonder if there are other commands to set ups FSD? I can not find any. only "upsmon -c fsd", but that command seems do too much. thanks a lot for hint!! Regards, tbskyd
On Sep 11, 2015, at 5:21 AM, d tbsky <tbskyd at gmail.com> wrote:> > hi: > my testing server has two power supply and attach to two ups. one > of the ups is connect to the server with usb. > my upsmon.conf like below: > > # for two ups > MONITOR ftups at localhost 1 monmaster nutmaster master > MONITOR ftups at 10.1.1.2 1 monslave nutslave slave > MINSUPPLIES 1 > > # for early shutdown > NOTIFYFLAG ONBATT EXEC+WALL+SYSLOG > NOTIFYFLAG ONLINE EXEC+WALL+SYSLOG > NOTIFYCMD /usr/sbin/upssched > > the early shutdown script use "upsmon -c fsd" to set FSD to > master ups. but when testing, the "upsmon -c fsd" not only set FSD to > ups, it also create /etc/killpower and run SHUTDOWNCMD and terminate > itself, although I have a live second ups connection. > > I wonder if there are other commands to set ups FSD? I can not > find any. only "upsmon -c fsd", but that command seems do too much."upsmon -c fsd" sets the FSD flag on all of the UPSes attached to upsd. In the per-UPS context, FSD means that the UPS was commanded to shut down from an external source (a control panel, for instance). If you want to experiment with various combinations of OB+LB on multiple UPSes, I would recommend swapping out one or more drivers with dummy-ups. -- Charles Lepple clepple at gmail
[please keep the list CC'd - use "Reply All".] On Sep 14, 2015, at 10:29 PM, d tbsky <tbskyd at gmail.com> wrote:> > 2015-09-14 20:28 GMT+08:00 Charles Lepple <clepple at gmail.com>: >> "upsmon -c fsd" sets the FSD flag on all of the UPSes attached to upsd. > > my nut version is 2.7.3. as I said, "upsmon -c fsd" not only set > the FSD flag, it will also > > 1. create /etc/killpower > 2. run SHUTDOWNCMD > 3. terminate upsmon itselfRight, that is what upsmon does when the FSD flag is set.> this will cause problem when doing early shutdown at "big-server" > environment (eg: multiple power supply, multiple ups attached to > different host). > > fortunately I found fedora/redhat rpm include the python PyNUT, so I > can write a simple script to set ups FSD without trigger SHUTDOWNCMD.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.> but maybe upsmon would want to fix the behavior..-- Charles Lepple clepple at gmail
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