[Nut-upsuser] Good Day NUT

Dinow Hsieh dinow at upspowercom.com.tw
Fri May 12 03:20:03 UTC 2017


Good Day Roger


AA. Could you show us your current configuration files?

==> Yes. My configurations as below :

    1. File = nut.conf
        MODE=standalone

    2. File = ups.conf
        [pcmups]
            driver = usbhid-ups
            port = auto
            desc = "pcmups test"

    3. File = upsmon.conf
        MONITOR pcmups at localhost 1 pcmups 22258552 master
        MINSUPPLIES  1
        SHUTDOWNCMD  "/sbin/shutdown -h +0"
        NOTIFYCMD  "/etc/nut/notifycmd"
        POLLFREQ  5
        POLLFREQALERT  5
        HOSTSYNC  15
        DEADTIME  15
        POWERDOWNFLAG  /etc/killpower
        NOTIFYFLAG  ONLINE  SYSLOG+WALL
        NOTIFYFLAG  ONBATT  SYSLOG+WALL+EXEC
        NOTIFYFLAG  LOWBATT  SYSLOG+WALL+EXEC
        RBWARNTIME  43200
        NOCOMMWARNTIME  300
        FINALDELAY  5

    4. File = upsd.users
        [pcmups]
            password=22258552
            action=SET
            instcmds=ALL
            upsmon master

    5. File = notifycmd
    #!/bin/bash
    #
    # NUT NOTIFYCMD script
    PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
    trap "exit 0" SIGTERM
    if [ "$NOTIFYTYPE" = "ONLINE" ]
    then
        echo $0: power restored | wall
        # Cause all instances of this script to exit.
        killall -s SIGTERM `basename $0`
    fi
    if [ "$NOTIFYTYPE" = "ONBATT" ]
    then
        echo $0: 3 minutes till system powers down... | wall
        # Loop with one second interval to allow SIGTERM reception.
        let "n = 180"
        while [ $n -ne 0 ]
        do
                sleep 1
                let "n--"
        done
        echo $0: commencing shutdown | wall
        upsmon -c fsd
    fi    6. File =upssched.conf
        CMDSCRIPT  /bin/upssched-cmd
        PIPEFN  /var/run/nut/upssched/upssched.pipe
        LOCKFN  /var/run/nut/upssched/upssched.lock

    ==> Above 6 files I place in the same directory "/etc/nut/"

BB. What does command "ps aux | grep ups"  report?

==> Yes. Below is the concise result

    root  upstart-udev-bridge --daemon
    root  upstart-socket-bridge  --daemon
    root  upstart-file-bridge  --daemon
    root  /usr/sbin/cups-browsed
    dinow  upstart-event-bridge
    dinow  upstart-file-bridge  --daemon --user
    dinow  upstart-dbus-bridge  --daemon  --system  --user  --bus-name 
system
    dinow  upstart-dbus-bridge  --daemon  --session  --user  --bus-name 
session
    nut  /lib/nut/usbhid-ups  -a  pcmups
    nut  upsd
    root  upsmon
    nut  upsmon
    root  /usr/sbin/cupsd  -f
    lp  /usr/lib/cups/notifier/dbus  bus://


CC. Do you have a script in a systemd system-shutdown directory which calls 
"upsdrvctl shutdown" ?

==> No

==> I have tried this command "upsdrvctl shutdown" as below results (However 
the UPS still sustain the power)

    Network UPS Tools - UPS driver controller 2.7.1
    Network UPS Tools - Generic HID driver 0.38 (2.7.1)
    USB communication driver 0.32
    Using subdriver : PowerCOM HID 0.4
    Initiating UPS shutdown



==> Thanks for your reading and hope your any advices

Sincerely yours, May. 12th
Dinow Hsieh
----- Original Message ----- 
From: "Roger Price" <roger at rogerprice.org>
To: "nut-upsuser Mailing List" <nut-upsuser at lists.alioth.debian.org>
Sent: Thursday, May 11, 2017 3:55 PM
Subject: Re: [Nut-upsuser] Good Day NUT


> On Thu, 11 May 2017, Dinow Hsieh wrote:
>
>> ==> AA. I confront an issue that can't shutdown the ups With the nut,
>> I can get the ups status(upsc) and shutdown the linux-ubuntu when power
>> failure occurs(upsmon) But don't know which configuration I ignore to
>> setup for ups shutdown
>
> Hi, Could you show us your current configuration files?  Remove the
> comments and the blank lines.  What does command "ps aux | grep ups"
> report?
>
> Do you have a script in a systemd system-shutdown directory which calls
> "upsdrvctl shutdown" ?
>
> Roger


--------------------------------------------------------------------------------


> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser





More information about the Nut-upsuser mailing list