Hi,
I'm absolute new with nut, and I'm using a UPS a first time.
I'm running Manjato LXQT with a APC-Smartups-1500 connected to ttyS0. Installed NUT from the Arch-Linux AUR.
So starting and stopping the ups software is done via systemd.
 
My configuration is working so far. I can check values with upsc and I'm getting mails, when the power line ist disconnected and reconneted.
Shutting down the machine works if I do this via console with 'upsmon -c fsd'.
But no automatic shutdown :(
 
If I try to set battery.runtime.low > 300 I get an error. See below.
 
 
# upsd -V
Network UPS Tools upsd 2.7.4
 
# upsrw -s battery.runtime.low=301 -u admin -p aXXX apcsmartups
Unexpected response from upsd: ERR INVALID-VALUE
 
# upsrw -s battery.runtime.low=301 -u admin -p aXXX apcsmartups
OK
 
# upsc apcsmartups
battery.alarm.threshold: 0
battery.charge: 073.0
battery.charge.restart: 00
battery.date: 19/25/10
battery.packs: 000
battery.runtime: 11400
battery.runtime.low: 300
battery.voltage: 25.24
battery.voltage.nominal: 024
device.mfr: APC
device.model: Smart-UPS 1500
device.serial: AS0940230792
device.type: ups
driver.name: apcsmart
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyS0
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.internal: 3.1
input.frequency: 50.00
input.quality: 00
input.sensitivity: H
input.transfer.high: 253
input.transfer.low: 208
input.transfer.reason: unacceptable utility voltage rate of change
input.voltage: 000.0
input.voltage.maximum: 000.0
input.voltage.minimum: 000.0
output.voltage: 231.0
output.voltage.nominal: 230
ups.delay.shutdown: 090
ups.delay.start: 000
ups.firmware: 653.18.I
ups.id: UPS_IDEN
ups.load: 000.0
ups.mfr: APC
ups.mfr.date: 09/30/09
ups.model: Smart-UPS 1500
ups.serial: AS0940230792
ups.status: OB
ups.temperature: 022.5
ups.test.interval: 1209600
ups.test.result: NO
 
 
So I tried to change ups.conf like this:
[apcsmartups]
    driver = apcsmart
    port = /dev/ttyS0
    desc = "APC-SmartUPS 1500 @ Falcon"
    ignorelb
    override.battery.charge.low = -1
    override.battery.runtime.low = 11000
 
My question here is: Can I set values greater then 300 in ups.conf ist those values are not allowed with upsrw?
It seems that no shtudown is initiated. No Mail, no log entry, nothing. Why?
 
Henning
 
 
By the way. The link to search within the list responds 404.
http://www.networkupstools.org/lists/
 
...
 
 
Here comes  the rest of my config ...
 
nut.conf
========
MODE=none

upsd.users:
===========
[admin]
        actions = SET
        instcmds = ALL
        password  = aXXX
[upsmon]
        password  = uXXX
        upsmon master

upsmon.conf
===========
RUN_AS_USER nut
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
NOTIFYCMD /usr/bin/upssched
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
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+WALL+EXEC
NOTIFYFLAG ONBATT       SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT      SYSLOG+WALL+EXEC
NOTIFYFLAG FSD      SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK       SYSLOG+EXEC
NOTIFYFLAG COMMBAD      SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN     SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT     SYSLOG+EXEC
NOTIFYFLAG NOCOMM       SYSLOG+EXEC
NOTIFYFLAG NOPARENT     SYSLOG+EXEC
MONITOR apcsmartups 1 upsmon uXXX master
SHUTDOWNCMD poweroff

upssched.conf
=============
CMDSCRIPT /usr/local/bin/upssched.sh
PIPEFN /var/lib/nut/upssched/upssched.pipe
LOCKFN /var/lib/nut/upssched/upssched.lock
AT ONLINE * CANCEL-TIMER onbatt online
AT ONBATT * START-TIMER onbatt 60
AT LOWBATT * EXECUTE lowbatt
AT FSD * EXECUTE fsd
AT COMMOK * CANCEL-TIMER commbad commok
AT COMMBAD * START-TIMER commbad 30
AT NOCOMM *     START-TIMER combad 30
AT SHUTDOWN * EXECUTE shutdown
AT REPLBATT * EXECUTE replbatt
AT NOPARENT * EXECUTE noparent

upssched.sh
========
#!/bin/bash
PARM1=$1
OFN="/tmp/upssched-mail.txt"
MAILTO="xxxdxxx.de"
DATUM=`date +"%F %T"`
HOST=`hostname`
STAT=`upsc apcsmartups ups.status`
RUNTIME=`upsc apcsmartups battery.runtime`
BATT=`upsc apcsmartups battery.charge`
function shutdwn () {
        sleep 30
        upsmon -c fsd
}
case $NOTIFYTYPE in
    ONBATT|onbatt)
    echo -e "UPS runs on Battery for more then 1 minute now!" >$OFN
    ;;
    ONLINE|online)
    echo -e "UPS is back on Line Power." >$OFN
    ;;
    COMMBAD|combad)
    echo -e "Communication with UPS lost!" >$OFN
    ;;
    COMMOK|commok)
    echo -e "Communication with UPS re-established." >$OFN
    ;;
    SHUTDOWN|shutdown)
    echo -e "Shutdown due to UPS Event initiated!" >$OFN
    shutdwn
    ;;
    FSD|fsd)
    echo -e "Forced Shutdown due to UPS Event initiated!!!" >$OFN
    shutdwn
    ;;
    LOWBATT|lowbatt)
    echo -e "UPS battery low, awaiting shutdown!" >$OFN
    ;;
    REPLBATT|replbatt)
    echo -e "UPS battery needs to be replaced!" >$OFN
    ;;
    NOCOMM|nocomm)
    echo -e "UPS cannot be reached!" >$OFN
    ;;
    NOPARENT|noparent)
    echo -e "UPS parent process died - shutdown impossible!" >$OFN
    ;;
    *)
    echo "wrong parameter $NOTIFYTYPE" >$OFN;;
esac
echo -e "\nBattery Charge: $BATT%\nUPS Status: $STAT\nUPS Runtime: $RUNTIME seconds\n" >>$OFN
mail -s "$UPSNAME@$HOST $DATUM $PARM1" $MAILTO <$OFN
exit 0
 
_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to