Hi Roger,

/sbin/upssched is the standard binary that installs with the Debian NUT package.  From my understanding, /sbin/upssched then calls CMDSCRIPT (in my case, /etc/nut/upssched-cmd) passing some parameters to that script.  Here is my /etc/nut/upssched-cmd:
#!/bin/bash
#
# This script should be called by upssched via the CMDSCRIPT directive.
#
# Here is a quick example to show how to handle a bunch of possible
# timer names with the help of the case structure.
#
# This script may be replaced with another program without harm.
#
# The first argument passed to your CMDSCRIPT is the name of the timer
# from your AT lines.
OPTION="$1"
SCRIPT="$0"

logger -t $SCRIPT "Script called with arg $OPTION"

case $OPTION in
    lowbatt)
        MSG="NUT upssched \"lowbatt\" sequence start: UPS Low Battery; Begin shutting down clients"
        echo "$SCRIPT: $MSG"
        logger -t $SCRIPT "$MSG"
        /etc/nut/scripts/shutdown-control &
        MSG="NUT upssched \"lowbatt\" sequence initiated"
        echo "$SCRIPT: $MSG"
        logger -t $SCRIPT "$MSG"
        ;;
    onbatt)
        logger -t $SCRIPT "UPS on battery"
        ;;
    online)
        logger -t $SCRIPT "UPS power restored and back online"
        ;;
    upsgone)
        logger -t $SCRIPT "The UPS has been gone for awhile"
        ;;
    *)
        logger -t $SCRIPT "Unrecognized arg: $OPTION"
        ;;
esac

exit 0

The shutdown-control script shuts down multiple Windows desktops and NAS devices when the "lowbatt" state is triggered by NUT.

But if I understand the question correctly, I think we're getting ahead of ourselves.

The driver is giving this incorrect response (simulated for illustration purposes - not actual):
$ upsc myups1
Init SSL without certificate database
battery.charge: 1
...


I don't think there's any turning back unless I can get the NUT upsmon to retry or wait for a second POLLFREQ interval.  Let me know your thoughts and appreciate the help.

Thanks,
-MikeD


Date: Saturday, May 25, 2019, at 09:52:13 AM PDT (GMT/UMT -0700)
From: Roger Price <[email protected]>
To: Nut Users <[email protected]>
Subject: Re: [Nut-upsuser] Low Battery False Alarms

On Sat, 25 May 2019, Mike Dillinger wrote:

I have a CyberPower 1350VA and it's around 2 to 3 years old.  I'm seeing random occurrences of low battery false alarm indicators with a battery supply of 1%.  I would assume this means the unit needs replacement, but in the meantime, is there any way I can ask upsmon to verify with two consecutive POLLFREQ intervals?  Meaning, try again one more time. 

What does your /sbin/upssched look like?  Do you EXECUTE a further script on AT LOWBATT?

Roger

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



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

Reply via email to