Re: [Nut-upsuser] testing shutdown: pc not restarting; and "ups unavailable" messages

2018-02-02 Thread nut . user . u830
> NUT takes charge of sending the required commands through the driver; the 
> default values are load.off.delay 20 and load.on.delay 30.  These values can 
> be 
> changed by adding lines such as
> 
> offdelay = 30
> ondelay = 100
> 
> to the corresponding UPS section in file ups.conf.

This sounded like a very appealing and sensible suggestion, thanks, so I just 
tried it.

I edited /etc/nut/ups.conf to contain the following stanza

[cyber]
driver = usbhid-ups
port = auto
desc = "Cyber Power Systems VALUE800EILCD"
offdelay = 30
ondelay = 100

and then I "tested the shutdown sequence" with

sudo upsmon -c fsd

The computer duly shut down but then didn't come back up for 3 minutes, at 
which point I power-cycled it by removing and re-inserting the cable. (By the 
way, 5 seconds of off time wasn't enough to wake it up, but 30 was.)

So what else could be wrong? 

- Should I have written load.off.delay instead of offdelay?

- Should I have issued any other command to cause the driver to read its 
ups.conf file?

- Could it be that the second issue I reported in my original message to the 
list is also affecting what happens?
http://lists.alioth.debian.org/pipermail/nut-upsuser/2018-February/011034.html 


I am still getting quite a few console broadcasts that "UPS cyber@localhost is 
unavailable" and (a) I don't know why (b) I wonder if this is preventing nut 
from telling the UPS those new values for the on-delay and off-delay.

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] testing shutdown: pc not restarting; and "ups unavailable" messages

2018-02-02 Thread nut . user . u830
> I have an older box set up this way for continuous integration, and it needs 
> to see more than a few seconds of power loss for the "always turn on" BIOS 
> setting to work. I forget how many different intervals I tried, but 30 
> seconds of off time is reliable for that particular box.

Thanks. This matches my limited experience from yesterday with 2 computers 
including the one that's actually attached to the UPS I'm trying to get to 
work. 

If power is cut and restored when the computer is already off (and with the 
always-on BIOS setting), then: short off time, it doesn't notice and it remains 
off; long off time, it does come back on. I did one minute for "long" but 
didn't do binary partitioning of the interval to assess the exact threshold.___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] testing shutdown: pc not restarting; and "ups unavailable" messages

2018-02-01 Thread nut . user . u830
> > where in the filesystem should I be looking for the NUT shutdown script 
> > please?
> 
> It's the SHUTDOWNCMD in upsmon.conf

Thanks!

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] testing shutdown: pc not restarting; and "ups unavailable" messages

2018-02-01 Thread nut . user . u830
> It actually occurred to me that I could try this with another (any other) 
> computer here at work, so I did. I set the BIOS to "always on" after power 
> cut. I booted ubuntu. I did "sudo shutdown -h now" from the console. The pc 
> switched off as expected. Then I removed the power cable and then plugged it 
> back in. According to the theory above, this should have caused the computer 
> to detect a power loss and turn itself back on. Instead it remained off (as I 
> expected).

In light of the last few messages I tried again but this time I kept it off for 
a few minutes rather than a few seconds before plugging the power cord back in, 
and this time it did come back on. Wow! (That's still the computer at work, 
though.)

If it is possible that this is motherboard-dependent I shall have to try again 
with the media server computer at home that is supposed to be rescued by the 
UPS. I envisage two cases.

1) if the computer does restart after I switch it off and then pull and (a 
while later) reinsert the power cord, then it stands a chance of working with 
the UPS, but I still need to understand why it hasn't worked so far.

2) if the computer stays off, there is little hope that any software 
configuration of nut will make the ups turn it back on; except perhaps for 
Lee's suggestion of "turning it off but not quite". On that note, where in the 
file system should I be looking for the NUT shutdown script please?




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] testing shutdown: pc not restarting; and "ups unavailable" messages

2018-02-01 Thread nut . user . u830
> When a UPS unit performs a delayed power off (NUT sets the delay to 20 
> seconds 
> by default) it deconnects its power outlets which in some UPS units produces 
> an 
> audible "clunk".  The display of lights on the front panel changes, and the 
> beeping stops.  The delayed power off can be demonstrated with a light bulb 
> or a 
> mains circuit tester connected to one of the UPS power outlets.


Out of curiosity: if the PC has already been switched off from software by the 
shutdown script, how would it know that the power has been cut while it was 
off? Are you telling me that the power supply of the PC keeps checking its 
incoming AC supply even while off, and that with the BIOS setting I selected it 
will wake up the PC even after a power cut DURING WHICH the PC was already off? 
I never imagined that... I guess it's something I could try independently, once 
I find a quiet time with no disk activity when it's OK to shut down that 
computer.

> I looked at the product documentation at 
> https://www.cyberpower.com/uk/en/product/sku/Value800EILCD and could find 
> nothing about shutting down the UPS power outlets. Although the 800EILCD is 
> able 
> to turn off the beeper, this in itself is not sufficient. The proposed 
> typical 
> applications include NAS & Servers so it should be possible. Perhaps you 
> could 
> ask the Cyber Power support people if the 800EILCD has this function.

What exactly should I be asking? "Is it possible to switch off the power to the 
outgoing outlet by sending a command to the UPS via USB, and what is that 
command?" They provide their own Linux software, which I ignored in favour of 
NUT, so I suspect their answer, if any, might be limited to what can be done 
through that.

> I see at http://networkupstools.org/ddl/Cyber_Power_Systems/Value_800E.html 
> that 
> the Value 800E does not have variables such as
>  load.off.delay - Turn off the load with a delay (seconds)
>  load.on.delay - Turn on the load with a delay (seconds)
> 
> What does command ? upscmd -l  ? report?

I'll try this tonight when I'm back home.

Many thanks for your help.

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


[Nut-upsuser] testing shutdown: pc not restarting; and "ups unavailable" messages

2018-01-31 Thread nut . user . u830

Executive summary:

I am installing a UPS with NUT on Ubuntu for the first time. I could 
follow the instructions up to "testing shutdowns" but on executing the 
recommended command the computer shuts down and never comes back on, 
contrary to what the instructions suggest.


I am also seeing regular broadcast messages on the console that the UPS 
is unavailable (and in the  syslog that the connection timed out), 
although the physical USB connection seems to be OK.


Where should I be looking to diagnose the fault?




Details:

OS: Ubuntu 16.04.3 LTS

exact NUT version: nut is already the newest version (2.7.2-4ubuntu1.2).

NUT installation method: from source tarball, package or Subversion:
sudo apt install nut nut-monitor usbhid-ups
exact device name and related information (manufacturing date, web 
pointers, …),

Cyber Power Value 800EILCD
https://www.cyberpower.com/uk/en/product/sku/Value800EILCD

complete problem description, with any relevant traces, like system log 
excerpts, and driver debug output. You can obtain the latter using the 
following command, as root and after having stopped NUT:


I followed the instructions at
http://networkupstools.org/docs/user-manual.chunked/ar01s06.html
adjusting the paths as appropriate for ubuntu. However when I get to 
"Testing shutdowns" and "You can finally test a forced shutdown sequence 
[...] If everything works correctly, the computer will power on again".


The latter does not happen. The computer shuts down and never comes back 
up unless I turn it back on manually at the power switch.


The instructions then say that "If your UPS just sits there and never 
resets the load, you are vulnerable to a power race and should add the 
"reboot after timeout" hack at the very least."


I presume this hack is the one in the code box a few lines above, namely

 if (test -f /etc/killpower)
    then
    echo "Killing the power, bye!"
    /usr/local/ups/bin/upsdrvctl shutdown

    sleep 120

    # uh oh... the UPS power-off failed
    # you probably want to reboot here so you don't get stuck!
    # *** see also the section on power races in the FAQ! ***
    fi

But two doubts about it:

1) should I still do it despite the warning above it that "this step is 
not need[ed] if you installed from packages", which I did?


2) If I am supposed to add this into my shutdown scripts, what is their 
path? I could not find that anywhere in the whole page by searching for 
"shutdown scripts".


Finally, a possibly related and possibly unrelated issue is that I get a 
number of messages like this on the console


Broadcast message from nut@sauron (somewhere) (Mon Jan 29 09:55:42 2018):

UPS cyber@localhost is unavailable

and in /var/log/syslog

Jan 29 09:55:02 sauron upsmon[2385]: Poll UPS [cyber@localhost] failed - 
Data stale
Jan 29 09:55:42 sauron upsmon[2385]: message repeated 8 times: [ Poll 
UPS [cyber@localhost] failed - Data stale]

Jan 29 09:55:42 sauron upsmon[2385]: UPS cyber@localhost is unavailable
Jan 29 09:55:47 sauron upsmon[2385]: Poll UPS [cyber@localhost] failed - 
Data stale
Jan 29 09:55:52 sauron upsmon[2385]: Poll UPS [cyber@localhost] failed - 
Data stale
Jan 29 09:55:56 sauron upsd[2377]: Send ping to UPS [cyber] failed: 
Resource temporarily unavailable
Jan 29 09:55:57 sauron upsd[2377]: Connected to UPS [cyber]: 
usbhid-ups-cyber
Jan 29 09:55:57 sauron upsmon[2385]: Poll UPS [cyber@localhost] failed - 
Driver not connected


but occasionally it says it can connect:

Jan 29 09:56:02 sauron upsmon[2385]: Communications with UPS 
cyber@localhost established


Where should I be looking to find out what the problem is?

Help and advice gratefully received.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser