[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

15 hours ago, PilaScat said:

Hi, today my new UPS (APC BX1200MI-GR) arrived, set it up and charging, but in the notification I'm getting this:
image.png.f68a30ff3c7e85675b9dc3a9d8623fa4.png

Is not true, it's going to 100%

Other screens:
image.thumb.png.8e2b8c07689ff2be2c9c30ca02c22ce7.png

image.thumb.png.01a223859419a134bc53ce0513894407.png

While making the screens I saw live the percentage going to 0% then back to 99%, triggering the notification
I'm connected to NUT with Home Assistant for automation, but I'm on standalone, it works but is it correct?
Yes I have powertop but I checked and it isn't touching the UPS USB, and it worked the same with the old UPS, same UPS but 950VA

nut-debug-20240316165522.zip 14.74 kB · 0 downloads

 

Hello!


This is unfortunately a known bug in the NUT backend driver (not the plugin) with that UPS series at the moment, which we're currently investigating. Do you perhaps have a chance to try the other older NUT backends (NUT Settings => Network UPS Tools Backend Switch => ideally reboot or at least reinstall plugin after switching the backend) if it also happens with the older versions? This would help us a lot to close in on what is causing the bug by comparison so we can hopefully fix it in the APC driver as soon as possible.

 

An unrelated question, how are you connected to NUT with Home Assistant when you're using "standalone" NUT mode? Normally that should only work in "netserver" NUT mode.   Edit: Nevermind, just tested it and NUT also exposes the general UPS information in "standalone" mode.

 

https://github.com/networkupstools/nut/issues/2347

 

Thanks in advance! 🙂 

 

Edited by Rysz
Link to comment
On 3/4/2024 at 3:31 PM, Rysz said:

 

It is reported either by the UPS or the UPS driver, you can disable the notification itself in the NUT Settings ("Battery Replacement Notification" to "No"), but you'll always see it in the UPS Status (in GUI) if that's what your UPS or UPS driver reports. At least disabling the notification you won't be bothered with e-mail or push notifications from NUT about your battery needing a replacement anymore - so hope that helps a bit!

 

If possible can you also post the NUT Debug Package here (can be found in NUT Settings) so I can take a look at what else might be causing the UPS status to be reported this way? Thanks in advance!

 

Hello.

I've been away for a few weeks, but here are the debug logs attached.

(I was getting battery replacement warnings on my new APC BX series UPS)

 

I know I can disable this feature, but i find it very useful, to get notification, when the battery needs replacement eventually, and the UPS has this automatic self test every 2 weeks.

Last time I got the replacement warning was yesterday 9:24PM (march 16th). 

Thanks for looking into it!

 

nut-debug-20240317235549.zip

Link to comment
6 hours ago, LSL1337 said:

Hello.

I've been away for a few weeks, but here are the debug logs attached.

(I was getting battery replacement warnings on my new APC BX series UPS)

 

I know I can disable this feature, but i find it very useful, to get notification, when the battery needs replacement eventually, and the UPS has this automatic self test every 2 weeks.

Last time I got the replacement warning was yesterday 9:24PM (march 16th). 

Thanks for looking into it!

 

nut-debug-20240317235549.zip 15.18 kB · 0 downloads

 

Hello, in the meantime it was discovered there's currently a backend driver bug with the BX series (see post above) which we're working on. Many BX users are reporting false RB or LB states, so it's NUT and not your UPS. I hope there'll be a fix soon, I'll keep you posted.

 

Same as above, can you please try the other backends with the backend switch in NUT Settings (reboot or reinstall plugin afterwards) to see if it happens on the older backend versions also?

 

Edited by Rysz
Link to comment
7 minutes ago, PilaScat said:

From what I can see the problem started after march 11 release, I'll try to switch backend when I can reboot the server

 

Thanks - you can also reinstall the NUT plugin after changing the backend if you can't reboot. Interesting would be if it works on "release (2.8.0 stable)" in particular. The issue with that series must be older than March, because NUT 2.8.1. was released 10/2023 and the default backend the plugin uses was compiled from that release by me 11/2023 and has remained unchanged since then.

 

Edited by Rysz
Link to comment

Responding to below post dated 3/18/24, subject: NUT with APC Back-UPS BGM1500 biweekly test shuts down immediately

 

The problem still persists but my current NUT version still shows 2.8.0. I have changed the default to 2.8.1 and rebooted. Ther backend now shows version nut-2.8.1-x86_64-2stable.ssl11, and is running. Will advise if the the issue occurs (based on previous schedule, it should shutdown on 3/26/24 at ~1:00am). Thanks for the message!

 

 

Edited by hfuhruhurr
  • Thanks 1
Link to comment

I've had the NUT V2 plugin up and running for sometime now, recently I seem to stop getting data from it after a few mins to hours.

phoenix-diagnostics-20240318-1711.zip

I checked the USB cable, and ran the auto detect in the plugin again which seems to work but after a bit it fails again.

I even tried replacing the USB cable with a new one.

Might someone have some insight into what is breaking?

I see this repeated in the logs.

 

Mar 18 17:12:51 phoenix upsmon[1164]: Poll UPS [[email protected]] failed - Data stale
Mar 18 17:12:53 phoenix usbhid-ups[978]: libusb1: Could not open any HID devices: insufficient permissions on everything
Mar 18 17:12:55 phoenix usbhid-ups[978]: libusb1: Could not open any HID devices: insufficient permissions on everything


Which from my searching seems could be a failed USB cable?

I'm just hoping the UPS (or rather the USB controller / port on it) isn't going bad.

Link to comment
9 hours ago, snowmirage said:

I've had the NUT V2 plugin up and running for sometime now, recently I seem to stop getting data from it after a few mins to hours.

phoenix-diagnostics-20240318-1711.zip

I checked the USB cable, and ran the auto detect in the plugin again which seems to work but after a bit it fails again.

I even tried replacing the USB cable with a new one.

Might someone have some insight into what is breaking?

I see this repeated in the logs.

 

Mar 18 17:12:51 phoenix upsmon[1164]: Poll UPS [[email protected]] failed - Data stale
Mar 18 17:12:53 phoenix usbhid-ups[978]: libusb1: Could not open any HID devices: insufficient permissions on everything
Mar 18 17:12:55 phoenix usbhid-ups[978]: libusb1: Could not open any HID devices: insufficient permissions on everything


Which from my searching seems could be a failed USB cable?

I'm just hoping the UPS (or rather the USB controller / port on it) isn't going bad.

 

Can you please post the NUT Debug Package (can be found in NUT Settings) ?

Link to comment

running ==  nut-2.8.1-x86_64-2stable.ssl11

 

has something been updated to remove the settings on NUT to set

 

Battery level to initiate shutdown (%):

Runtime left to initiate shutdown (minutes):

Time on battery before shutdown (seconds):

 

as i seem to have lost those options in NUT settings and we have had two power cuts in the last 12 hours and the server has not switched off due to not being told to.

 

i had it set 2 minutes after noticing a power cut, shut down.

 

how do i put that back?

Link to comment
15 minutes ago, Jammy B said:

running ==  nut-2.8.1-x86_64-2stable.ssl11

 

has something been updated to remove the settings on NUT to set

 

Battery level to initiate shutdown (%):

Runtime left to initiate shutdown (minutes):

Time on battery before shutdown (seconds):

 

as i seem to have lost those options in NUT settings and we have had two power cuts in the last 12 hours and the server has not switched off due to not being told to.

 

i had it set 2 minutes after noticing a power cut, shut down.

 

how do i put that back?

 

No it's not been removed, it's only visible in "Enable Manual Configuration Mode": "No" or "for UPS Driver" because those settings are misleading in manual configuration mode "Yes" as they won't function if you're using a different notification script directive in upsmon.conf (which some people do). If your UPS requires specific configuration lines to work with NUT (as I remember yours does) you'll have to set "Enable Manual Configuration Mode:" to "for UPS Driver" - it'll then respect your manual configuration for the UPS driver but let you configure the shutdowns and other settings at the same time.

 

Regardless if you didn't make any changes in upsmon.conf (especially to the line: NOTIFYCMD "/usr/sbin/nut-notify") it should've shut down as before even if the settings weren't directly visible anymore. In fact I just tested it from my server with your exact same configuration and it shut down after 2 minutes just fine. Do you perhaps have logs from before the shutdown and are you sure NUT registered that your UPS is on battery correctly? Did you get any notifications that the UPS is on battery?

 

Please post the NUT Debug Package (can be found in NUT Settings).

 

Edited by Rysz
Link to comment
5 minutes ago, Rysz said:

 

No it's not been removed, it's only visible in "Enable Manual Configuration Mode": "No" or "for UPS Driver" because those settings are misleading in manual configuration mode "Yes" as they won't function if you're using a different notification script directive in upsmon.conf (which some people do). If your UPS requires specific configuration lines to work with NUT (as I remember yours does) you'll have to set "Enable Manual Configuration Mode:" to "for UPS Driver" - it'll then respect your manual configuration for the UPS driver but let you configure the shutdowns and other settings at the same time.

 

Regardless if you didn't make any changes in upsmon.conf (especially to the line: NOTIFYCMD "/usr/sbin/nut-notify") it should've shut down as before even if the settings weren't directly visible anymore. In fact I just tested it from my server with your exact same configuration and it shut down after 2 minutes just fine. Do you perhaps have logs from before the shutdown and are you sure NUT registered that your UPS is on battery correctly? Did you get any notifications that the UPS is on battery?

 

 

you are the best!

 

that fixed it and re-instated my old settings.

 

thank you. 

 

no notifcations as i wasn't home when it lost power so it couldn't get the messages out.

 

thanks for remembering how "cool" my Powercool was! :) 

Link to comment
1 minute ago, Jammy B said:

 

 

you are the best!

 

that fixed it and re-instated my old settings.

 

thank you. 

 

no notifcations as i wasn't home when it lost power so it couldn't get the messages out.

 

thanks for remembering how "cool" my Powercool was! :) 

 

Sure, no problem, still can you post the NUT Debug Package? Just want to make sure your configuration is good too because that shouldn't have happened even if you didn't see the settings anymore. Did you have to do a parity check when you started the server again or how are you not sure that it didn't shutdown the system as it should have?

Link to comment
9 minutes ago, snowmirage said:


Never noticed that tiny text oops :)

Here it is

nut-debug-20240319083604.zip 14.7 kB · 1 download

 

The configuration looks good to me. One last thing to try would be enabling "Enable USB Power Management Override" to see if that helps the situation and is related to power management on a software level.

 

Did you make any significant changes to the UPS (battery/settings), the physical connection (different USB cable/port) or NUT (changed backend/updated from much older version) recently that could correlate with this issue? If it worked well before then it looks to me like maybe that USB port is dying, hopefully not the USB interface on the UPS itself. Beware if you reconnect to another USB port you should do "Reset Config" and "Auto Config" again because the "Auto Config" fixes it on a specific USB port.

 

Usually is one of these reason if things worked well before and start dropping out (more likely to less likely):

  • NUT settings recently changed around
  • UPS settings recently changed around
  • UPS firmware or NUT backend recently updated
  • USB cable between Unraid machine and UPS faulty or dead
  • USB port on Unraid machine faulty or dead
  • USB port on UPS faulty or dead
  • USB controller on UPS faulty or dead
  • USB controller on Unraid machine faulty or dead
  • Unraid version recently updated & now HW compatibility/driver issue
Link to comment
11 minutes ago, Rysz said:

 

Sure, no problem, still can you post the NUT Debug Package? Just want to make sure your configuration is good too because that shouldn't have happened even if you didn't see the settings anymore. Did you have to do a parity check when you started the server again or how are you not sure that it didn't shutdown the system as it should have?

 

yeah its doing a parity check.

 

looks like the power cut has revealed other issues as when i cut the power to the UPS, the UPS just goes off. 

 

so i've directly connected to the UPS with a laptop via USB and the battery is 0%. i don't know if its just because it has been flattened and needs time to re-charge or if its f##ked. its only as old as my posts on here asking if NUT could get it!

 

i've disabled sleep/shutdown on the server as it won't finish a Parity check by midnight. when i get back home from work tonight i will have a look at battery % again.

 

worrying part is the SOC on NUT is dictated by the battery voltages i've manually entered. seems i need to do some further investigation on this as NUT won't know the battery is flat either.

 

will update this evening. thanks again.

 

 

Link to comment
Just now, Jammy B said:

 

yeah its doing a parity check.

 

looks like the power cut has revealed other issues as when i cut the power to the UPS, the UPS just goes off. 

 

so i've directly connected to the UPS with a laptop via USB and the battery is 0%. i don't know if its just because it has been flattened and needs time to re-charge or if its f##ked. its only as old as my posts on here asking if NUT could get it!

 

i've disabled sleep/shutdown on the server as it won't finish a Parity check by midnight. when i get back home from work tonight i will have a look at battery % again.

 

worrying part is the SOC on NUT is dictated by the battery voltages i've manually entered. seems i need to do some further investigation on this as NUT won't know the battery is flat either.

 

will update this evening. thanks again.

 

 

 

Yeah that seems like a multifaceted problem there, perhaps your UPS battery is degraded and couldn't even hold the battery load long enough for NUT to kick in and even begin with the shutdown. From experience 2 minutes can be a very long time depending on your power draw and if your UPS battery is not able to sustain it you'll have a shutdown. That might also be the root problem with the battery voltages inside NUT, so perhaps a new battery would be worth trying and it'll also resolve your voltage situation for those voltage directives to no longer be required. Just an idea... 🙂 

Link to comment
On 3/19/2024 at 1:01 PM, Rysz said:

 

Yeah that seems like a multifaceted problem there, perhaps your UPS battery is degraded and couldn't even hold the battery load long enough for NUT to kick in and even begin with the shutdown. From experience 2 minutes can be a very long time depending on your power draw and if your UPS battery is not able to sustain it you'll have a shutdown. That might also be the root problem with the battery voltages inside NUT, so perhaps a new battery would be worth trying and it'll also resolve your voltage situation for those voltage directives to no longer be required. Just an idea... 🙂 

 

 

Good morning!

 

i have now replaced the 2no batteries within the Powercool UPS and it is now functioning correctly.

 

running the UPS directly connected to my laptop via USB and running the software that came with the Powercool doesn't tell me anything about the battery health. As far as it is concerned, the batteries within the unit are fine.

 

now that i have replaced the batteries, the 2 minute process is working fine.

 

What do i need to do [besides remove my custom battery voltages] to enable NUT to accurately read from the UPS?

 

edit to add - the "battery capacity" doesn't change even with new batteries. i think the software is a bit "universal" as it has options to do tests that do not do anything.

 

 

uh-oh.png

Edited by Jammy B
Link to comment
21 hours ago, Jammy B said:

 

 

Good morning!

 

i have now replaced the 2no batteries within the Powercool UPS and it is now functioning correctly.

 

running the UPS directly connected to my laptop via USB and running the software that came with the Powercool doesn't tell me anything about the battery health. As far as it is concerned, the batteries within the unit are fine.

 

now that i have replaced the batteries, the 2 minute process is working fine.

 

What do i need to do [besides remove my custom battery voltages] to enable NUT to accurately read from the UPS?

 

edit to add - the "battery capacity" doesn't change even with new batteries. i think the software is a bit "universal" as it has options to do tests that do not do anything.

 

 

uh-oh.png

 

Nothing. NUT will by default show all the variables it can read from the UPS, but there's nothing more that can be done to increase the amount of those variables if the UPS driver does not support reading more. I'd just remove the custom voltage settings if they are not needed anymore and I think you're good. 🙂 

Link to comment
1 hour ago, Rysz said:

 

Nothing. NUT will by default show all the variables it can read from the UPS, but there's nothing more that can be done to increase the amount of those variables if the UPS driver does not support reading more. I'd just remove the custom voltage settings if they are not needed anymore and I think you're good. 🙂 

 

 

[ups]
driver = nutdrv_qx
port = auto
vendorid = 0001
productid = 0000
protocol = hunnox
langid_fix = 0x0409
novendor
noscanlangid
default.battery.voltage.high = 27.50
default.battery.voltage.low = 21.40
default.battery.voltage.nominal = 24.00
default.input.voltage.nominal = 230
runtimecal = 900,100,1800,50

 

 

removed:

 

default.battery.voltage.high = 27.50
default.battery.voltage.low = 21.40
default.battery.voltage.nominal = 24.00

 

Then Nut would not start.

 

changed the attribute to runtime.low and then it loaded.

 

see how that fares i guess. 
 

runtime-low.png

  • Like 1
Link to comment
On 12/19/2023 at 7:59 PM, Rysz said:

 

Hello!

 

This is caused by the pfSense side and is the fallout of the following bug:

https://github.com/networkupstools/nut/issues/2104

 

You cannot fix this from the UNRAID side, you need to update NUT on your pfSense to the latest version. The bug is already fixed in NUT 2.8.1 (or 2.8.2 on pfSense), so please check the pfSense's NUT version again because it looks like a version before 2.8.1. from the logs! After updating to the latest version on the pfSense, you can then test it by running a manual battery self-test on the UPS and checking if it still shuts down the pfSense (it shouldn't anymore). On UNRAID itself no changes are needed as it's already fixed there. 🙂

 

Sorry for bringing back a old post.

 

I get this in Unraid log:

 

Mar 25 11:22:19 UNRAID usbhid-ups[6922]: ups_status_set: seems that UPS [qnapups] is in OL+DISCHRG state now. Is it calibrating (perhaps you want to set 'onlinedischarge_calibration' option)? Note that some UPS models (e.g. CyberPower UT series) emit OL+DISCHRG when in fact offline/on-battery (perhaps you want to set 'onlinedischarge' option).

 

But everything works as it should and nothing is being shutdown when my APC UPS is doing its biweekly test. But it logs that above message. In previous poster he had problems with pfsense shutting down which i dont have problems with.

 

And according to documentation it states that APC models are effected.

Quote

 

onlinedischarge_calibration

If this flag is set, the driver will treat OL+DISCHRG status as calibration. Some UPS models (e.g. APC were seen to do so) report OL+DISCHRG when they are in calibration mode. This usually happens after a few seconds reporting an OFF state as well, while the hardware is switching to on-battery mode.

 

 

Can i add a flag/line some where to fix this or is not a "real" problem as its only shown in the logs?

Edited by ABEIDO
Link to comment
14 minutes ago, ABEIDO said:

Sorry for bringing back a old post.

 

I get this in Unraid log:

 

Mar 25 11:22:19 UNRAID usbhid-ups[6922]: ups_status_set: seems that UPS [qnapups] is in OL+DISCHRG state now. Is it calibrating (perhaps you want to set 'onlinedischarge_calibration' option)? Note that some UPS models (e.g. CyberPower UT series) emit OL+DISCHRG when in fact offline/on-battery (perhaps you want to set 'onlinedischarge' option).

 

But everything works as it should and nothing is being shutdown when my APC UPS is doing its biweekly test. But it logs that above message. In previous poster he had problems with pfsense shutting down which i dont have problems with.

 

And according to documentation it states that APC models are effected.

 

Can i add a flag/line some where to fix this or is not a "real" problem as its only shown in the logs?

 

You don't need to set this flag unless the log message is bothering you. That status itself is not a problem anymore because the OFF-state related bug (which some APC models experienced) has been fixed so that previously affected UPS do not falsely shutdown (when actually doing calibration) anymore.

 

If the log message bothers you, then you can put this flag in the ups.conf so that it reports CAL instead of OL DISCHRG. But honestly if everything works I would not bother because it's just a log message and doesn't cause any problem on its own.

 

  • Thanks 1
Link to comment
33 minutes ago, ABEIDO said:

Thanks for quick answer, its just me wanting to understand as much as i could about it all. I will leave it alone and not tinker with it as its only logs.

 

Sure, no problem, during battery testing the battery is usually discharged a bit for testing purposes and then charged again. That's the reason why you see OL (on line power) and DISCHRG (battery discharging) during your UPS battery testing process. Some UPS have a separate state CAL (battery calibration) for this, but many just report OL DISCHRG, OFF or OB or all of those during the testing process.

Link to comment

First of all: THANK YOU so much for actively maintaining this plugin.

 

I have a small feature request:

The plugin right now seems to dislike hyphenated UPS names, like ups-main and ups-22. The GUI does not let you enter those names, even in manual config mode hyphenated UPS names do not work correctly.

 

It would be great to support hyphenated UPS names.

  • Thanks 1
Link to comment
1 hour ago, UFKEL said:

First of all: THANK YOU so much for actively maintaining this plugin.

 

I have a small feature request:

The plugin right now seems to dislike hyphenated UPS names, like ups-main and ups-22. The GUI does not let you enter those names, even in manual config mode hyphenated UPS names do not work correctly.

 

It would be great to support hyphenated UPS names.

 

Hello, there seems to be some legacy code that's forcing the name to be alphanumeric.

I'll have to check if there's a reason for that (possibly breaking something) or if we can allow it.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.