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

2015-09-14 Thread Charles Lepple
On Sep 11, 2015, at 5:21 AM, d tbsky  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@localhost 1 monmaster nutmaster master
> MONITOR ftups@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@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] UPS/NUT with openSUSE 13.1

2015-09-14 Thread Rob Groner
I just tried it with a clean install of Ubuntu 14.04no problems, gives ups 
shutdown command just like it should.   So that's Ubuntu and Porteus: Good!  
openSUSE: Bad!

Rob Groner
Software Engineer Level II

RTD Embedded Technologies, Inc.
ISO 9001 and AS9100 Certified
Ph: +1 814-234-8087
www.rtd.com

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] stale/dead ups logic

2015-09-14 Thread Charles Lepple
[forwarding to the list]

On Sep 14, 2015, at 10:39 PM, d tbsky  wrote:
> 
> 2015-09-14 20:34 GMT+08:00 Charles Lepple :
>> I would recommend investigating ways around the "data stale" error, rather 
>> than investing time in logic that is only meant to be a last resort. The 
>> driver man pages mention a few cases where the NUT default timeouts might 
>> not be appropriate, and can be adjusted to avoid the "data stale" condition.
> 
>   if the host which attached to UPS crashed, there is no way to
> prevent "data stale". maybe  I can write script triggered by ups
> event. but that seems a little stupid since I already have "upsmon" to
> do most of the work. now I can only assume my environment won't have a
> "double fault": when one of the cluster server crashed or one of the
> power supply die, I won't get a power cut simultaneously...
> 
> Regards,
> tbskyd



___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


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

2015-09-14 Thread d tbsky
2015-09-15 10:38 GMT+08:00 Charles Lepple :
> 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
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


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

2015-09-14 Thread Charles Lepple
[please keep the list CC'd - use "Reply All".]

On Sep 14, 2015, at 10:29 PM, d tbsky  wrote:
> 
> 2015-09-14 20:28 GMT+08:00 Charles Lepple :
>> "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 itself

Right, 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@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser