[Nut-upsuser] Fw: [Nut-upsdev] POWERCOM-UPS-USB : UPS Shutdown

Dinow Hsieh dinow at upspowercom.com.tw
Tue May 16 03:56:11 UTC 2017


Good Day Roger Price

AA. Hi, Normally one would expect the UPS to disconnect it's power outlets
after the default ups.delay.shutdown = 20 seconds.

==> I got it. I tried to command "upsdrvctl shutdown" on both line-mode and 
battery-mode

==> But ups do not disconnect its outlets power


-----------------------------------------------------------------------------------
BB. Could you show us the output of command "upsc pcmups"?

==> Yes. Below 2 mode were the outputs of command "upsc pcmups"

B1. Battery Mode
dinow-All-Series:/etc/nut$ upsc pcmups
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 30
battery.date: 2010/12/20
battery.runtime: 784
battery.type: PbAc
device.mfr: POWERCOM Co.,LTD
device.model: HID UPS Battery
device.serial: 004-0D9F-000
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.7.1
driver.version.data: PowerCOM HID 0.4
driver.version.internal: 0.38
input.frequency: 0.0
input.voltage: 0.0
input.voltage.nominal: 120
output.frequency: 0.0
output.voltage: 120.0
output.voltage.nominal: 120
ups.date: 2010/12/20
ups.delay.shutdown: 20
ups.delay.start: 60
ups.load: 4
ups.mfr: POWERCOM Co.,LTD
ups.model: HID UPS Battery
ups.productid: 0004
ups.serial: 004-0D9F-000
ups.status: OB DISCHRG
ups.test.result: Done and passed
ups.timer.shutdown: 120
ups.timer.start: 740160
ups.vendorid: 0d9f


B2. Nomal Mode
dinow-All-Series:/etc/nut$ upsc pcmups
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 100
battery.charge.warning: 30
battery.date: 2010/12/20
battery.runtime: 800
battery.type: PbAc
device.mfr: POWERCOM Co.,LTD
device.model: HID UPS Battery
device.serial: 004-0D9F-000
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.7.1
driver.version.data: PowerCOM HID 0.4
driver.version.internal: 0.38
input.frequency: 59.0
input.voltage: 111.0
input.voltage.nominal: 120
output.frequency: 59.0
output.voltage: 120.0
output.voltage.nominal: 120
ups.date: 2010/12/20
ups.delay.shutdown: 20
ups.delay.start: 60
ups.load: 5
ups.mfr: POWERCOM Co.,LTD
ups.model: HID UPS Battery
ups.productid: 0004
ups.serial: 004-0D9F-000
ups.status: OL
ups.test.result: Done and passed
ups.timer.shutdown: 0
ups.timer.start: 755760
ups.vendorid: 0d9f



-----------------------------------------------------------------------------------
CC. Once the command "upsdrvctl shutdown" works, you will need to 
incorporate
it in your shutdown process.

==> I got it


NUT 2.7.4 includes file .../scripts/systemd/nutshutdown . Does Ubunti 
install this?

==> Yes. Ubuntu haved installed this as below contents

dinow-All-Series:/lib/systemd/system-shutdown$ cat nutshutdown
#!/bin/sh
/sbin/upsmon -K >/dev/null 2>&1 && /sbin/upsdrvctl shutdown


-----------------------------------------------------------------------------------
DD. Does wall successfully notify the users on an Ubuntu system?   If you 
type

    echo "Hello from wall" | wall

do the users of Gnome, KDE, LXDE, LightDM etc see the message?

==> Yes. I used the putty and got below 3 messages
(Battery Power / Power Resotre / and type commands directly)


D1. Broadcast Message from dinow-Al
        (somewhere) at 10:59 ...

UPS pcmups at localhost on battery


D2. Broadcast Message from dinow-Al
        (somewhere) at 11:00 ...

UPS pcmups at localhost on line power


D3. Broadcast Message from dinow-Al
        (/dev/pts/0) at 11:02 ...

Hello from wall


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

EE. Perhaps the BSD syntax doesn't work on Debian, ps -elf | grep -E
"nut|upsd|upsmon" would have been better.

==> dinow-All-Series:/etc/nut$ ps -elf|grep -E "nut|upsd|upsmon"

1 S root      1010     1  0  80   0 -  9421 -      11:09 ?        00:00:00 
/sbin/upsmon
5 S nut       1012  1010  0  80   0 - 11335 -      11:09 ?        00:00:00 
/sbin/upsmon
1 S nut       1065     1  0  80   0 -  4324 -      11:09 ?        00:00:00 
/lib nut/usbhid-ups -a pcmups
1 S nut       1067     1  0  80   0 -  9424 -      11:09 ?        00:00:00 
/sbin/upsd
4 S root      2199     1  0  80   0 - 19215 -      11:10 ?        00:00:00 
/usr/sbin/cupsd -f
0 S dinow     2447  2395  0  80   0 -  3989 pipe_w 11:11 pts/2    00:00:00 
grep --color=auto -E nut|upsd|upsmon


-----------------------------------------------------------------------------------
FF. I will make a note for next time.

==> Deep Appreciation for your reply



If you have any questions, please don't hesitate to inform us.
Sincerely yours, May. 16th
Dinow Hsieh
----- Original Message ----- 
From: "Roger Price" <roger at rogerprice.org>
To: "nut-upsuser Mailing List" <nut-upsuser at lists.alioth.debian.org>
Sent: Monday, May 15, 2017 6:06 PM
Subject: Re: [Nut-upsuser] Fw: [Nut-upsdev] POWERCOM-UPS-USB : UPS Shutdown


> On Mon, 15 May 2017, Dinow Hsieh wrote:
>
>> ==> 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
>
> Hi, Normally one would expect the UPS to disconnect it's power outlets
> after the default ups.delay.shutdown = 20 seconds.  Could you show us the
> output of command "upsc pcmups"?
>
>> CC. Do you have a script in a systemd system-shutdown directory which 
>> calls
>> "upsdrvctl shutdown" ?
>>
>> ==> No
>
> Once the command "upsdrvctl shutdown" works, you will need to incorporate
> it in your shutdown process.  NUT 2.7.4 includes file
> .../scripts/systemd/nutshutdown . Does Ubunti install this?
>
>  >   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
>
> Does wall successfully notify the users on an Ubuntu system?   If you type
>
>    echo "Hello from wall" | wall
>
> do the users of Gnome, KDE, LXDE, LightDM etc see the message?
>
>> fi 6. File =upssched.conf
>> CMDSCRIPT /bin/upssched-cmd
>> PIPEFN /var/run/nut/upssched/upssched.pipe
>> LOCKFN /var/run/nut/upssched/upssched.lock
>
> It doesn't look as if upssched will be called, since your NOTIFYCMD is
> pointing to your script and not upssched.  So upssched.conf will not be
> used.
>
>> BB. What does command "ps aux | grep ups" report?
>>
>> ==> Yes. Below is the concise result
>> ...
>> nut /lib/nut/usbhid-ups -a pcmups
>> nut upsd
>> root upsmon
>> nut upsmon
>
> Perhaps the BSD syntax doesn't work on Debian, ps -elf | grep -E
> "nut|upsd|upsmon" would have been better.  I will make a note for next
> time.
>
> Roger


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


> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170516/e7b90419/attachment.html>


More information about the Nut-upsuser mailing list