NUT package (2.8.0 and below)
-
@gertjan At the end of the shutdown process, the NUT master does send a command to the UPS to kill the power (after a delay).
-
@dennypage said in NUT package:
At the end of the shutdown process, the NUT master does send a command to the UPS to kill the power (after a delay).
Aha : I hope there is some known delay then, because when NUT sends that command, the host system is still running.
System can take their time to shut down (to really power or cold mode).Thanks, because you said so, my brain started to help me to finding this : https://networkupstools.org/docs/user-manual.pdf page 35 and further on "NUT outlets management".
-
@kevindd992002 said in NUT package:
If I remember correctly, when we were discussing this a few years ago, we came to a conclusion that ignorelb is needed for the warning/low battery thresholds override to work.
You are correct. Thank you for reminding me.
Ignorelb code reference here.
-
@gertjan said in NUT package:
@dennypage said in NUT package:
At the end of the shutdown process, the NUT master does send a command to the UPS to kill the power (after a delay).
Aha : I hope there is some known delay then, because when NUT sends that command, the host system is still running.
System can take their time to shut down (to really power or cold mode).Thanks, because you said so, my brain started to help me to finding this : https://networkupstools.org/docs/user-manual.pdf page 35 and further on "NUT outlets management".
Yes, that's the ups.shutdown.delay that you see in your post above. It's also what @dennypage mentioned to me in the past.
Your APC and both my APC and EATON UPS'es have a default value of 20 seconds.
-
@dennypage so I can write to the ups.delay.shutdown variable with upsrw but the values do not persist after a NUT service restart. Do you know of a away to have the modification persist?
Also, I tried removing all the overrides + ignorelb and let the UPS use its default low battery threshold of 60%. At 60% it sent an FSD and waited for 3 minutes of HOSTSYNC. Then it waited for the default 20 secs ups.delay.shutdown. As soon as it turned off power from its outlets, it starting back up again even though it still in battery mode (no mains) and beeping.
-
@kevindd992002 said in NUT package:
so I can write to the ups.delay.shutdown variable with upsrw but the values do not persist after a NUT service restart.
Same observation here.
When I set "ups.shutdown.delay" to 25 (it was 20) the UPS (on pfSense) show the new value :
But : did it get 'written' to the UPS ??
Restaring NUT gve me the old '20'. back.
Like NUT 'resets' the UPS to default values ?
No a big issue, I guess it's possible to send values to the UPS on "NUT" start-up.I know now I can actually send commands to the UPS :
[2.5.2-RELEASE][admin@pfsense.local.net]/root: upscmd ups test.battery.start.quick Username (root): admin Password: OK
The UPS did the battery test.
I wonder if :
upscmd ups load.off
works ;)
-
@gertjan said in NUT package:
@kevindd992002 said in NUT package:
so I can write to the ups.delay.shutdown variable with upsrw but the values do not persist after a NUT service restart.
Same observation here.
When I set "ups.shutdown.delay" to 25 (it was 20) the UPS (on pfSense) show the new value :
But : did it get 'written' to the UPS ??
Restaring NUT gve me the old '20'. back.
Like NUT 'resets' the UPS to default values ?
No a big issue, I guess it's possible to send values to the UPS on "NUT" start-up.I know now I can actually send commands to the UPS :
[2.5.2-RELEASE][admin@pfsense.local.net]/root: upscmd ups test.battery.start.quick Username (root): admin Password: OK
The UPS did the battery test.
I wonder if :
upscmd ups load.off
works ;)
Yeah, it looks like upsrw only writes at runtime. Not sure how to make it persist.
For upcsmd and load.off, that command is considered "dangerous" as per the statement here :)
-
@kevindd992002 said in NUT package:
@dennypage so I can write to the ups.delay.shutdown variable with upsrw but the values do not persist after a NUT service restart. Do you know of a away to have the modification persist?
My UPS is EATON Ellipse PRO 650
Settings master pfSense-box Advanced Additional upsmon.conf:
HOSTSYNC 60Settings master pfSense-box Advanced Additional ups.conf:
(this makes settings permanent for UPS, ondelay >> offdelay)
offdelay 30
ondelay 60Setting client/slave XP-box upsmon.conf:
shutdown -s -t 0Simulation:
/usr/local/sbin/upsmon -c fsdReality in action:
1 s shutdown action start master pfSense-box & HOSTSYNC(max.60)
1 s announce shutdown on slave XP-box & shutdown action start XP-box(23 s) pfSense-box kill-signal to UPS, start UPS offdelay(30)
(23 s) pfSense-box Halted, waiting on HOSTSYNC(max.60) for XP-box40 s XP-box power-off, therefore takes 40 s
43 s pfSense-box power-off (XP-box signals DEAD to pfSense-box)53 s UPS power-off, offdelay(30) expired (started when pfSense-box Halted)
83 s UPS power-on, ondelay(60) expired, booting pfSense-box etc.
Source of more information:
"https://dan.langille.org/2020/09/07/monitoring-your-ups-using-nut-on-freebsd/" -
@hda said in NUT package:
@kevindd992002 said in NUT package:
@dennypage so I can write to the ups.delay.shutdown variable with upsrw but the values do not persist after a NUT service restart. Do you know of a away to have the modification persist?
My UPS is EATON Ellipse PRO 650
Settings master pfSense-box Advanced Additional upsmon.conf:
HOSTSYNC 60Settings master pfSense-box Advanced Additional ups.conf:
(this makes settings permanent for UPS, ondelay >> offdelay)
offdelay 30
ondelay 60Setting client/slave XP-box upsmon.conf:
shutdown -s -t 0Simulation:
/usr/local/sbin/upsmon -c fsdReality in action:
1 s shutdown action start master pfSense-box & HOSTSYNC(max.60)
1 s announce shutdown on slave XP-box & shutdown action start XP-box(23 s) pfSense-box kill-signal to UPS, start UPS offdelay(30)
(23 s) pfSense-box Halted, waiting on HOSTSYNC(max.60) for XP-box40 s XP-box power-off, therefore takes 40 s
43 s pfSense-box power-off (XP-box signals DEAD to pfSense-box)53 s UPS power-off, offdelay(30) expired (started when pfSense-box Halted)
83 s UPS power-on, ondelay(60) expired, booting pfSense-box etc.
Source of more information:
"https://dan.langille.org/2020/09/07/monitoring-your-ups-using-nut-on-freebsd/"Thanks for that information!
Why does the offdelay start at 23s?
For the upsmon fsd simulation test, does the UPS automatically turn its outlets ON immediately after turning them off?
-
@kevindd992002 said in NUT package:
Also, I tried removing all the overrides + ignorelb and let the UPS use its default low battery threshold of 60%.
60%? That doesn't make much sense to me. Default low battery is usually 5-15%.
You probably should reach out to the UPS manufacturer to discuss their intended behavior.
-
@kevindd992002 said in NUT package:
Thanks for that information!
Why does the offdelay start at 23s?
For the upsmon fsd simulation test, does the UPS automatically turn its outlets ON immediately after turning them off?
Concluded later from my pfSense log:
-:03:14 request FSD
-:03:30 power-down by root
-:03:37 syslogd exiting on signal 15total 23 s
As you can read, 83 - 53 = 30 sec before UPS turns on again.
It is important that "ONdelay" is longer than "OFFdelay".
-
@gertjan said in NUT package:
When I set "ups.shutdown.delay" to 25 (it was 20) the UPS (on pfSense) show the new value :
But : did it get 'written' to the UPS ??
Restaring NUT gve me the old '20'. back.
Like NUT 'resets' the UPS to default values ?
No a big issue, I guess it's possible to send values to the UPS on "NUT" start-up.If you are using usb (usbhid-ups), I believe the answer is yes, they are reset every time. See the Extra Arguments section in the NUT documentation.
@kevindd992002 if you are using usb, you may want to consider using -1 for ondelay based on the feedback you get from your UPS vendor.
-
@dennypage said in NUT package:
@kevindd992002 said in NUT package:
Also, I tried removing all the overrides + ignorelb and let the UPS use its default low battery threshold of 60%.
60%? That doesn't make much sense to me. Default low battery is usually 5-15%.
You probably should reach out to the UPS manufacturer to discuss their intended behavior.
Yeah, I know 5-15% is the default value for my APC UPS. Not sure what's up with this Eaton. @hda can you confirm what is the default low battery threshold for your Eaton UPS?
@hda said in NUT package:
@kevindd992002 said in NUT package:
Thanks for that information!
Why does the offdelay start at 23s?
For the upsmon fsd simulation test, does the UPS automatically turn its outlets ON immediately after turning them off?
Concluded later from my pfSense log:
-:03:14 request FSD
-:03:30 power-down by root
-:03:37 syslogd exiting on signal 15total 23 s
As you can read, 83 - 53 = 30 sec before UPS turns on again.
It is important that "ONdelay" is longer than "OFFdelay".
The turn on sequence for this test only happens because of the fsd simulation, right? When a real blackout occurs, the UPS turns off itself (plus its outlets) and will only turn back on when the mains come back, correct?
@dennypage said in NUT package:
@gertjan said in NUT package:
When I set "ups.shutdown.delay" to 25 (it was 20) the UPS (on pfSense) show the new value :
But : did it get 'written' to the UPS ??
Restaring NUT gve me the old '20'. back.
Like NUT 'resets' the UPS to default values ?
No a big issue, I guess it's possible to send values to the UPS on "NUT" start-up.If you are using usb (usbhid-ups), I believe the answer is yes, they are reset every time. See the Extra Arguments section in the NUT documentation.
@kevindd992002 if you are using usb, you may want to consider using -1 for ondelay based on the feedback you get from your UPS vendor.
Ahh, that's interesting. For all these parameters/variables, what does a -1 value mean? Disabled? And yes, I'm using usb and the usbhid-ups driver.
-
@kevindd992002 said in NUT package:
Not sure what's up with this Eaton. @hda can you confirm what is the default low battery threshold for your Eaton UPS?
My EATON has battery low default 20%
Can set it in ups.conf with "lowbatt = 20"
-
@hda said in NUT package:
@kevindd992002 said in NUT package:
Not sure what's up with this Eaton. @hda can you confirm what is the default low battery threshold for your Eaton UPS?
My EATON has battery low default 20%
Can set it in ups.conf with "lowbatt = 20"
Ok. Then mine is definitely weird at 60%. Without any kind of manual settings modification, does your Eaton UPS work as it should with NUT? Just wondering.
-
@kevindd992002 said in NUT package:
Then mine is definitely weird at 60%
How old is the battery ?
It can understand that an older battery hasn't the same discharge time. Ones the battey mode is activated, it will drain much faster. To compensate, this percentage would need to be higher.
Totally depleting a battery is a big no-no. -
@gertjan said in NUT package:
@kevindd992002 said in NUT package:
Then mine is definitely weird at 60%
How old is the battery ?
It can understand that an older battery hasn't the same discharge time. Ones the battey mode is activated, it will drain much faster. To compensate, this percentage would need to be higher.
Totally depleting a battery is a big no-no.2 years or so. I see. Is this generally true for all brands? How can I test for sure?
-
@kevindd992002 said in NUT package:
Without any kind of manual settings modification, does your Eaton UPS work as it should with NUT?
UPS out-of-the-box & NUT is probably not suitable for anyone.
My EATON is doing fine as I want & tell it with NUT conf-files.
The simulation with FSD is comparable with realtime BATTERY-LOW behaviour.
Read my previous post about my setup and experience.Again with offdelay(), NUT can claim/secure UPS battery-running-time
even when all boxes are already killed.The offdelay countdown starts when NUT master (pfSense) finalises its shutdown (halting).
I think max. HOSTSYNC-time cannot override offdelay-time.So you have to tune, match (offdelay_seconds) with (=)
(slowest_slave_shutdown_seconds - master(pfSense)_shutdown_seconds + your_safety_margin_seconds).
This time reservation must fit in the remaining time for lowbatt %.N.B. if slave boxes cannot finalise with the standard/default offdelay-time (=15 ? =20 ?),
then your UPS will cut-out too early (or it already ran out of "juice" earlier). -
@kevindd992002 said in NUT package:
For all these parameters/variables, what does a -1 value mean? Disabled?
It's specifically for that variable. The value is actually sent to the UPS. Have to go look at the USB HID spec to understand the intent.
-
@dennypage said in NUT package:
If you are using usb (usbhid-ups), I believe the answer is yes, they are reset every time. See the Extra Arguments section in the NUT documentation.
For entertainment value, I took a quick look... with usbhid it's not that the value is reset each time, it's that the value must be sent to the UPS to perform the shutdown.
Here's some relevant info from the spec:
DelayBeforeReboot
Writing this value immediately shuts down (i.e., turns off) the output for a period equal to the indicated number of seconds in DelayBeforeReboot, after which time the output is started. If the number of seconds required to perform the request is greater than the requested duration, then the requested shutdown and startup cycle shall be performed in the minimum time possible, but in no case shall this require more than the requested duration plus 60 seconds. If the startup should occur during a utility failure, the startup shall not occur until the utility power is restored.When read, DelayBeforeReboot returns the number of seconds remaining in the countdown, or –1 if no countdown is in progress.
DelayBeforeStartup
Writing this value starts the output after the indicated number of seconds in DelayBeforeStartup. Sending this command with 0 causes the startup to occur immediately. Sending this command with –1 aborts the countdown. If the output is already on at the time the countdown reaches 0, nothing happens. On some systems, if the USB driver on the device side is restarted while a startup countdown is in effect, the countdown is aborted. If the countdown expires during a utility failure, the startup shall not occur until the utility power is restored. Writing this value overrides the effect of any DelayBeforeStartup countdown or DelayBeforeReboot countdown in progress.When read, DelayBeforeStartup returns the number of seconds remaining in the countdown, or –1 if no countdown is in progress.
DelayBeforeShutdown
Writing this value shuts down (i.e., turns off) either the output after the indicated number of seconds, or sooner if the batteries become depleted. Sending this command with 0 causes the shutdown to occur immediately. Sending this command with –1 aborts the countdown. If the system is already in the desired state at the time the countdown reaches 0, there is no additional action (i.e. there is no additional action if the output is already off). On some systems, if the USB driver on the device side is restarted while a shutdown countdown is in effect, the countdown may be aborted. Writing this value overrides any DelayBeforeShutdown countdown already in effect.When read, DelayBeforeShutdown will return the number of seconds remaining until shutdown, or –1 if no shutdown countdown is in effect.