Re: [Nut-upsuser] Shutdown variables

2022-12-04 Thread Simon Wilson via Nut-upsuser

Thanks, useful.

Started with 2 x levels of debug, and grepped for that element, I see:

Dec  5 14:25:28 emp80 nut-driver@eaton5sx[1418584]:   5.108828#011[D1]  
Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Input,  
ReportID: 0x02, Offset: 8, Size: 8, Value: 0
Dec  5 14:25:29 emp80 nut-driver@eaton5sx[1418584]:   6.419040#011[D2]  
Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Feature,  
ReportID: 0x02, Offset: 8, Size: 8, Value: 0


So is that the UPS telling the driver that it is reporting on it, but  
with value 0? It's the same entries as on the 5S 1000 extract you  
linked.


What are the Input and Feature lines respectively?

Simon.

- Message from Charles Lepple  -
Date: Sun, 4 Dec 2022 21:23:06 -0500
From: Charles Lepple 
Reply-To: Nut-upsuser 
 Subject: Re: [Nut-upsuser] Shutdown variables
  To: si...@simonandkate.net
  Cc: Nut-upsuser 



On Nov 27, 2022, at 8:21 PM, Simon Wilson via Nut-upsuser wrote:


"[replbatt] The UPS needs to have its battery replaced. Not all  
UPS's can indicate this."


Can anyone advise whether the Eaton USB UPSs support that?  
Specifically mine is a 5SX 1750.


I don't know for the 5SX line in particular, but if you have a  
maintenance window where you can stop NUT, then start the usbhid-ups  
driver manually with a few -D flags (was 2+ for older versions of  
NUT), there is a HID descriptor element you can look for:


UPS.PowerSummary.PresentStatus.NeedReplacement

and that gets mapped to the RB flag in ups.status, and "Replace  
battery!" in ups.alarm.


If the 5SX is a superset of the 5S, then it should have this. A 5S  
1000 log is here:  
https://alioth-lists.debian.net/pipermail/nut-upsuser/2016-May/010122.html


Reference:

https://github.com/networkupstools/nut/blob/v2.8.0/drivers/mge-hid.c#L1264  
(assuming your UPS has a vendorid of 0x0463) maps the variable to  
replacebatt_info -> mapped to "replacebatt" string in  
drivers/usbhid-ups.c, then to RB:  
https://github.com/networkupstools/nut/blob/v2.8.0/drivers/usbhid-ups.c#L1681-L1683



- End message from Charles Lepple  -



--
Simon Wilson
M: 0400 12 11 16


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


Re: [Nut-upsuser] Shutdown variables

2022-12-04 Thread Charles Lepple via Nut-upsuser
On Nov 27, 2022, at 8:21 PM, Simon Wilson via Nut-upsuser wrote:
> 
> "[replbatt] The UPS needs to have its battery replaced. Not all UPS's can 
> indicate this."
> 
> Can anyone advise whether the Eaton USB UPSs support that? Specifically mine 
> is a 5SX 1750.

I don't know for the 5SX line in particular, but if you have a maintenance 
window where you can stop NUT, then start the usbhid-ups driver manually with a 
few -D flags (was 2+ for older versions of NUT), there is a HID descriptor 
element you can look for:

UPS.PowerSummary.PresentStatus.NeedReplacement

and that gets mapped to the RB flag in ups.status, and "Replace battery!" in 
ups.alarm.

If the 5SX is a superset of the 5S, then it should have this. A 5S 1000 log is 
here: https://alioth-lists.debian.net/pipermail/nut-upsuser/2016-May/010122.html

Reference:

https://github.com/networkupstools/nut/blob/v2.8.0/drivers/mge-hid.c#L1264 
(assuming your UPS has a vendorid of 0x0463) maps the variable to 
replacebatt_info -> mapped to "replacebatt" string in drivers/usbhid-ups.c, 
then to RB: 
https://github.com/networkupstools/nut/blob/v2.8.0/drivers/usbhid-ups.c#L1681-L1683

-- 
clepple@gmail
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Shutdown variables

2022-11-27 Thread Simon Wilson via Nut-upsuser
- Message from Simon Wilson via Nut-upsuser  
 -

Date: Sun, 27 Nov 2022 23:31:13 +1000
From: Simon Wilson via Nut-upsuser 
Reply-To: si...@simonandkate.net
 Subject: Re: [Nut-upsuser] Shutdown variables
  To: nut-upsuser@alioth-lists.debian.net



- Message from Roger Price  -
   Date: Sun, 27 Nov 2022 13:53:40 +0100 (CET)
   From: Roger Price 
Subject: Re: [Nut-upsuser] Shutdown variables
 To: Simon Wilson via Nut-upsuser 



On Sun, 27 Nov 2022, Simon Wilson via Nut-upsuser wrote:

Per  
https://networkupstools.org/docs/user-manual.chunked/ar01s06.html  
6.3, am I right in thinking, for my single server running NUT (in  
standalone mode) with connected USB UPS:


- when battery.charge reaches battery.charge.low: ups.status  
triggers to "LB" and upsmon sets an FSD in motion
- upsmon waits FINALDELAY 5 seconds, and calls my shutdown command  
(which then in sequence does a clean shutdown of my VMs before  
calling the 'real' shutdown command)

- my server then shuts down and powers off

Main question:

"ups.delay.shutdown" - at what point does this variable kick in?  
Is ups.delay.shutdown the period in seconds after FSD that the UPS  
will hard-shutdown, i.e. I need to ensure that my server can  
complete clean shutdown in that duration?


Yes, you do need to give your server sufficient time.
My understanding is that the ups.delay.shutdown is overwritten by  
the offdelay option in file ups.conf.


In the machine with which I type this, I have

rprice@titan ~ upsc Eaton ups.delay.shutdown
20
rprice@titan ~ grep offdelay /etc/nut/ups.conf
offdelay = 30

See https://rogerprice.org/NUT/ConfigExamples.A5.pdf chapter 2.5,  
and chapter 2.7 line 77.


Roger

___



That is great, thank you. From reading that I also note the comment  
that ondelay must be longer than offdelay.


My server takes 90s to 110s to do a full shutdown... but most of  
that is a scripted VM close before "shutdown -h +0" is finally  
called. I will do a timed test to be precise on the weekend, but  
until then I have put:


[eaton5sx]
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = ""
desc = "Eaton 5SX"
offdelay = 120
ondelay = 125
lowbatt = 30

...and restarted nut-driver. I then used upsc to confirm those  
settings had applied, which they had.


When I time it and see how long the actual post-VM-close shutdown  
takes I'll be able to reduce those significantly.


So, by my understanding from 2.6, my settings will trigger shutdown  
at 30% (42 mins of net runtime for this rack), the shutdown process  
will run on the server, including the nutshutdown command  
(/usr/lib/systemd/system-shutdown/nutshutdown on RH), which will  
then tell the UPS to power off at offdelay +2mins, with (if power  
has restored) a further 5 seconds before it can come back on (to  
ondelay).


I think I have got it, thank you again. That link's a very useful resource.

Simon.



- End message from Simon Wilson via Nut-upsuser  
 -



A followup question:

Noting in that document the following statement:

"[replbatt] The UPS needs to have its battery replaced. Not all UPS's  
can indicate this."


Can anyone advise whether the Eaton USB UPSs support that?  
Specifically mine is a 5SX 1750.


If they do not, what is the recommended way to check for health to  
maintain runtime and/or indicate time to change batteries?


Simon


--
Simon Wilson
M: 0400 12 11 16


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


Re: [Nut-upsuser] Shutdown variables

2022-11-27 Thread Simon Wilson via Nut-upsuser

- Message from Roger Price  -
   Date: Sun, 27 Nov 2022 13:53:40 +0100 (CET)
   From: Roger Price 
Subject: Re: [Nut-upsuser] Shutdown variables
 To: Simon Wilson via Nut-upsuser 



On Sun, 27 Nov 2022, Simon Wilson via Nut-upsuser wrote:

Per  
https://networkupstools.org/docs/user-manual.chunked/ar01s06.html  
6.3, am I right in thinking, for my single server running NUT (in  
standalone mode) with connected USB UPS:


- when battery.charge reaches battery.charge.low: ups.status  
triggers to "LB" and upsmon sets an FSD in motion
- upsmon waits FINALDELAY 5 seconds, and calls my shutdown command  
(which then in sequence does a clean shutdown of my VMs before  
calling the 'real' shutdown command)

- my server then shuts down and powers off

Main question:

"ups.delay.shutdown" - at what point does this variable kick in? Is  
ups.delay.shutdown the period in seconds after FSD that the UPS  
will hard-shutdown, i.e. I need to ensure that my server can  
complete clean shutdown in that duration?


Yes, you do need to give your server sufficient time.
My understanding is that the ups.delay.shutdown is overwritten by  
the offdelay option in file ups.conf.


In the machine with which I type this, I have

 rprice@titan ~ upsc Eaton ups.delay.shutdown
 20
 rprice@titan ~ grep offdelay /etc/nut/ups.conf
 offdelay = 30

See https://rogerprice.org/NUT/ConfigExamples.A5.pdf chapter 2.5,  
and chapter 2.7 line 77.


Roger

___



That is great, thank you. From reading that I also note the comment  
that ondelay must be longer than offdelay.


My server takes 90s to 110s to do a full shutdown... but most of that  
is a scripted VM close before "shutdown -h +0" is finally called. I  
will do a timed test to be precise on the weekend, but until then I  
have put:


[eaton5sx]
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = ""
desc = "Eaton 5SX"
offdelay = 120
ondelay = 125
lowbatt = 30

...and restarted nut-driver. I then used upsc to confirm those  
settings had applied, which they had.


When I time it and see how long the actual post-VM-close shutdown  
takes I'll be able to reduce those significantly.


So, by my understanding from 2.6, my settings will trigger shutdown at  
30% (42 mins of net runtime for this rack), the shutdown process will  
run on the server, including the nutshutdown command  
(/usr/lib/systemd/system-shutdown/nutshutdown on RH), which will then  
tell the UPS to power off at offdelay +2mins, with (if power has  
restored) a further 5 seconds before it can come back on (to ondelay).


I think I have got it, thank you again. That link's a very useful resource.

Simon.



--
Simon Wilson
M: 0400 12 11 16


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


Re: [Nut-upsuser] Shutdown variables

2022-11-27 Thread Roger Price

On Sun, 27 Nov 2022, Simon Wilson via Nut-upsuser wrote:

Per https://networkupstools.org/docs/user-manual.chunked/ar01s06.html 6.3, am 
I right in thinking, for my single server running NUT (in standalone mode) 
with connected USB UPS:


- when battery.charge reaches battery.charge.low: ups.status triggers to "LB" 
and upsmon sets an FSD in motion
- upsmon waits FINALDELAY 5 seconds, and calls my shutdown command (which 
then in sequence does a clean shutdown of my VMs before calling the 'real' 
shutdown command)

- my server then shuts down and powers off

Main question:

"ups.delay.shutdown" - at what point does this variable kick in? Is 
ups.delay.shutdown the period in seconds after FSD that the UPS will 
hard-shutdown, i.e. I need to ensure that my server can complete clean 
shutdown in that duration?


Yes, you do need to give your server sufficient time.
My understanding is that the ups.delay.shutdown is overwritten by the offdelay 
option in file ups.conf.


In the machine with which I type this, I have

 rprice@titan ~ upsc Eaton ups.delay.shutdown
 20
 rprice@titan ~ grep offdelay /etc/nut/ups.conf
 offdelay = 30

See https://rogerprice.org/NUT/ConfigExamples.A5.pdf chapter 2.5, and chapter 
2.7 line 77.


Roger

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


[Nut-upsuser] Shutdown variables

2022-11-27 Thread Simon Wilson via Nut-upsuser
Per https://networkupstools.org/docs/user-manual.chunked/ar01s06.html  
6.3, am I right in thinking, for my single server running NUT (in  
standalone mode) with connected USB UPS:


- when battery.charge reaches battery.charge.low: ups.status triggers  
to "LB" and upsmon sets an FSD in motion
- upsmon waits FINALDELAY 5 seconds, and calls my shutdown command  
(which then in sequence does a clean shutdown of my VMs before calling  
the 'real' shutdown command)

- my server then shuts down and powers off

Main question:

"ups.delay.shutdown" - at what point does this variable kick in? Is  
ups.delay.shutdown the period in seconds after FSD that the UPS will  
hard-shutdown, i.e. I need to ensure that my server can complete clean  
shutdown in that duration?


And second question:

On a RedHat server as above, do I need to alter any system shutdown  
script to pick up on the killpower POWERDOWNFLAG, or will the  
ups.delay.shutdown just kick in at its expiry and turn it off anyway?


Thanks
Simon.

--
Simon Wilson
M: 0400 12 11 16


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