[Nut-upsuser] battery not installed, but battery still 100% and NUT 2.7.2-4 does not catch this and report a error
Gene Heskett
gheskett at shentel.net
Mon Apr 3 20:11:06 UTC 2017
On Monday 03 April 2017 14:13:08 Stuart D. Gathman wrote:
Back on the mailing list, where such belongs.
> On Mon, 3 Apr 2017, Gene Heskett wrote:
> > Nut, IIRC, can do a periodic battery test by putting it offline,
> > using the battery, for a predetermined length of time, weekly,
> > monthly etc,
>
> We definitely don't want that in this instance either!
Why not? If the battery has a holdup time of 5 minutes when its fresh,
and a downtime of 30 seconds takes it down .2 volts, it can and will
stand a weekly 30 seconds on battery test once a week for 2 or 3 years,
which is about the life of a jellcell anyway, the point being that if at
the end of that 30 second test, the battery is down say .5 volts, its
time visit your version of batteries.com and get another set headed your
way.
> (Unless it is
> a dual PS server.)
Which quite likely will not load the battery significantly as it will
draw power from the highest voltage source, usually the powerline.
> We want the ALARM that the nut driver is
> generating, and upsd is passing on - to be acted on in some way by
> upsmon. Which NOTIFYCMD is run when there is an ALARM?
I've not read the docs in ages, but if there isn't something mentioned in
a man upsmon, I would be unpleasantly surprised.
According to my copy, it does a -wall (warn all) by default, and it looks
like REPLBATT is one such message, and the default time for a repeat is
12 hours. The -wall type message shows on every open terminal on the
system's network, so someone should see it. From the upsmon.conf file:
NOTIFYCMD command
upsmon calls this to send messages when things happen.
This command is called with the full text of the message as
one argument. The environment string NOTIFYTYPE will contain the type
string of whatever
caused this event to happen.
If you need to use upssched(8), then you must make it your
NOTIFYCMD by listing it here.
Note that this is only called for NOTIFY events that have EXEC
set with NOTIFYFLAG. See NOTIFYFLAG below for more details.
Making this some sort of shell script might not be a bad idea.
For more information and ideas, see pager.txt in the docs directory.
Remember, this command also needs to be one element in the
configuration file, so if your command has spaces, then wrap it in
quotes.
NOTIFYCMD "/path/to/script --foo --bar"
This script is run in the background—that is, upsmon forks
before it calls out to start it. This means that your NOTIFYCMD may have
multiple
instances running simultaneously if a lot of stuff happens all
at once. Keep this in mind when designing complicated notifiers.
NOTIFYMSG type message
upsmon comes with a set of stock messages for various events.
You can change them if you like.
NOTIFYMSG ONLINE "UPS %s is getting line power"
NOTIFYMSG ONBATT "Someone pulled the plug on %s"
Note that %s is replaced with the identifier of the UPS in
question.
Note that %s is replaced with the identifier of the UPS in
question.
The message must be one element in the configuration file, so
if it contains spaces, you must wrap it in quotes.
NOTIFYMSG NOCOMM "Someone stole UPS %s"
Possible values for type:
ONLINE
UPS is back online
ONBATT
UPS is on battery
LOWBATT
UPS is on battery and has a low battery (is critical)
FSD
UPS is being shutdown by the master (FSD = "Forced
Shutdown")
COMMOK
Communications established with the UPS
COMMBAD
Communications lost to the UPS
SHUTDOWN
The system is being shutdown
REPLBATT
The UPS battery is bad and needs to be replaced
NOCOMM
A UPS is unavailable (can’t be contacted for monitoring)
NOTIFYFLAG type flag[+flag][+flag]...
By default, upsmon sends walls global messages to all logged
in users) via /bin/wall and writes to the syslog when things happen. You
can change
this.
Examples:
There is more in that file than what I've quoted here. Recommended
reading.
But unless you actually do the weekly or even monthly, short "on battery"
test, its not likely you will ever see a replace batteries message
because I don't think that flag sets set by a power failure that takes
you down. Not time enough to set the flag.
The TANSTAAFL principle applies here, same as everyplace else.
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
More information about the Nut-upsuser
mailing list