[Nut-upsuser] No shutdown on empty battery

Arnaud Quette aquette.dev at gmail.com
Tue Jan 31 11:38:28 UTC 2012


2012/1/28 Gerhard Strangar <g.s at arcor.de>:
> Hello,

Hallo Gerhard

> I set up a FreeBSD 8.2 system with nut 2.6.1 and a Powerware 5115
> connected by RS-232. I expected this setup to shut down before running
> out of battery power, but I either missed some important configuration
> or something else went wrong:

just to clarify the situation:
by default, NUT only launch the SHUTDOWNCMD when ups.status has both
"OB" and "LB".
so you may not have let the power failure lasting enough (see the test
to be done at the end of this mail...)

> The syslog says:
> Jan  9 05:03:42 b1 upsmon[67752]: UPS upsb1 at localhost on battery
> Jan  9 05:04:42 b1 upsmon[67752]: UPS upsb1 at localhost on line power
> Jan  9 05:15:47 b1 upsmon[67752]: UPS upsb1 at localhost on battery
> Jan  9 05:18:22 b1 upsmon[67752]: UPS upsb1 at localhost on line power
> Jan  9 05:28:07 b1 upsmon[67752]: UPS upsb1 at localhost on battery
> Jan  9 05:28:47 b1 upsmon[67752]: UPS upsb1 at localhost on line power
> Jan  9 05:37:07 b1 upsmon[67752]: UPS upsb1 at localhost on battery
> Jan  9 06:15:19 b1 syslogd: kernel boot file is /boot/kernel/kernel
>
> No other messages in between. I got similar messages on a Windows box
> running LanSafe III, so the failure did get reported correctly. However,
> the nut did not shut down the system.

as told above, being on battery is not sufficient to trigger a system
shutdown...

> My upsmon.conf is:
> MONITOR upsb1 at localhost 1 upsmon suprpass master
> MINSUPPLIES 1
> SHUTDOWNCMD "init 0"
> POLLFREQ 5
> POLLFREQALERT 5
> HOSTSYNC 15
> DEADTIME 15
> POWERDOWNFLAG /etc/killpower
> NOTIFYMSG ONLINE        "UPS %s on line power"
> NOTIFYMSG ONBATT        "UPS %s on battery"
> NOTIFYMSG LOWBATT       "UPS %s battery is low"
> NOTIFYMSG FSD           "UPS %s: forced shutdown in progress"
> NOTIFYMSG COMMOK        "Communications with UPS %s established"
> NOTIFYMSG COMMBAD       "Communications with UPS %s lost"
> NOTIFYMSG SHUTDOWN      "Auto logout and shutdown proceeding"
> NOTIFYMSG REPLBATT      "UPS %s battery needs to be replaced"
> NOTIFYMSG NOCOMM        "UPS %s is unavailable"
> NOTIFYMSG NOPARENT      "upsmon parent process died - shutdown impossible"
> NOTIFYFLAG ONLINE       SYSLOG
> NOTIFYFLAG ONBATT       SYSLOG
> NOTIFYFLAG LOWBATT      SYSLOG
> NOTIFYFLAG FSD  SYSLOG
> NOTIFYFLAG COMMOK       SYSLOG
> NOTIFYFLAG COMMBAD      SYSLOG
> NOTIFYFLAG SHUTDOWN     SYSLOG
> NOTIFYFLAG REPLBATT     SYSLOG
> NOTIFYFLAG NOCOMM       SYSLOG
> NOTIFYFLAG NOPARENT     SYSLOG+WALL
> RBWARNTIME 43200
> NOCOMMWARNTIME 300
> FINALDELAY 5

everything seems fine.
I'm not a FreeBSD expert, but part of the shutdown sequence, the halt
script (or something equivalent) should be calling "upsdrvctl
-shutdown" if "upsmon -K" returns EXIT_SUCCESS ("0"). This will
trigger the UPS poweroff.

> I thought about implementing something like running a script which shuts
> down after running on battery for more than five minutes. But then it
> might be neccessary to cancel the shutdown if the power failure gets
> resolved. But in the scenario above, I guess my scripts might have
> failed as well.

this is what upssched is doing:
http://www.networkupstools.org/docs/user-manual.chunked/ar01s07.html

> The bcmxcp driver does report remaining runtime. I don't how how
> accurate it is, but the LS3 software allows to configure a shutdown time
> required by OS. Can I configure nut to shut down a few minutes earlier?
>
> battery.charge: 93
> battery.runtime: 1693
> battery.voltage: 12.71
> device.mfr: Eaton
> device.model: PW5115 500i
> device.serial: XcensoredX
> device.type: ups
> driver.name: bcmxcp
> driver.parameter.pollinterval: 2
> driver.parameter.port: /dev/ttyu0
> driver.version: 2.6.1
> driver.version.internal: 0.24
> [current input/output]
> ups.beeper.status: enabled
> ups.firmware: Cont:01.00 Inve:10.04
> ups.load:  20.4
> ups.mfr: Eaton
> ups.model: PW5115 500i
> ups.power: 102
> ups.power.nominal: 500
> ups.serial: XcensoredX
> ups.status: OL

a good test to do is:
- to shutdown your computer and unplug it from the UPS. You may want
to put a light bulb on the UPS instead of the computer,
- restart everything, then issue a power failure,
- check that NUT sees both OB (on battery) and most of LB (low
battery) flags in ups.status.
upsmon will also notify you, as you've already seen.

depending on the result, we will have a better visibility on your issue.

cheers,
Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsuser mailing list