Jump to content

[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

1 hour ago, Masterwishx said:

@Rysz After Ups shutdown and when power on again ,  ups.test.result not available (so no auto test) until i press test button on  the UPS by hand. is anyway i can set to run test if not enabled before by soft in settings or like this ?

OK i made the script ...

Link to comment

i've had NUT running a couple years now and one thing it does i still cannot solve.

 

the UPS runs 24/7.

 

my Unraid server does not, its on from 6am to midnight each day. When Unraid first boots, the battery % is at 0%. some point this afternoon, it have steadily "charged" itself up and got to 100%. i don't understand why it does this when it is 100% already as it is fully charged and on 24/7!

 

any suggestions on what i need to check/alter to make it display correctly? or am i totally misinterpreting something?

Link to comment
29 minutes ago, Jammy B said:

i've had NUT running a couple years now and one thing it does i still cannot solve.

 

the UPS runs 24/7.

 

my Unraid server does not, its on from 6am to midnight each day. When Unraid first boots, the battery % is at 0%. some point this afternoon, it have steadily "charged" itself up and got to 100%. i don't understand why it does this when it is 100% already as it is fully charged and on 24/7!

 

any suggestions on what i need to check/alter to make it display correctly? or am i totally misinterpreting something?

 

Does the UPS itself show as 100% charge (on the UPS display/LEDs) when this happens or does it show any indication that it's maybe really charging the battery? This is very very weird, especially that it "charges itself up" over time is usually really only seen when the UPS is in fact charging the battery somehow. I can't picture any programmatic problem that would make the driver increase the charge from 0% to 100% over time unless that's what the UPS also does... 😕 

 

Edited by Rysz
Link to comment
2 hours ago, Rysz said:

 

Does the UPS itself show as 100% charge (on the UPS display/LEDs) when this happens or does it show any indication that it's maybe really charging the battery? This is very very weird, especially that it "charges itself up" over time is usually really only seen when the UPS is in fact charging the battery somehow. I can't picture any programmatic problem that would make the driver increase the charge from 0% to 100% over time unless that's what the UPS also does... 😕 

 

 

no screen on my basic UPS - https://www.cclonline.com/pc-1000va-powercool-smart-ups-1000va-3-x-uk-plug-2-x-iec-rj45-x-2-usb-led-display/

 

the charging indicator is solid green which means charged and that doesn't change unless i have a powercut or manually kill power to it.

 

it powers my Unraid machine, UDMPRO, switch and CCTV NVR no problem. its never switched off and we don't get many powercuts and when we have its been flawless in signalling the Unraid machine to switch off.

 

its now on 52% charged as well. it was on 3% when i posted this morning

 

image.png.5c3e34a22543549e0085df458b5a9e09.png

 

is there a setting i might have put in to it that it is reading the wrong thing, but what would increase over time?

 

my 3 year old thread - 

 

 

 

 

 

 

 

Link to comment
6 hours ago, Jammy B said:

 

no screen on my basic UPS - https://www.cclonline.com/pc-1000va-powercool-smart-ups-1000va-3-x-uk-plug-2-x-iec-rj45-x-2-usb-led-display/

 

the charging indicator is solid green which means charged and that doesn't change unless i have a powercut or manually kill power to it.

 

it powers my Unraid machine, UDMPRO, switch and CCTV NVR no problem. its never switched off and we don't get many powercuts and when we have its been flawless in signalling the Unraid machine to switch off.

 

its now on 52% charged as well. it was on 3% when i posted this morning

 

image.png.5c3e34a22543549e0085df458b5a9e09.png

 

is there a setting i might have put in to it that it is reading the wrong thing, but what would increase over time?

 

my 3 year old thread - 

 

 

 

 

 

 

 

Now “charged”

 

IMG_3561.jpeg

Link to comment

So i recently purchased a new APC 1500M2 UPS for my unraid server. Hooked it up and have got it to the point of showing the stats and such of the battery etc.. 

 

I guess now what I am trying to understand is how I can make sure that if and when the battery gets to a certain % or something it either runs a script of sorts or at least lets met tell it to Stop all Docker Containers, VMs etc.. (as cleanly as you can), then unmount the array, then shutdown/power off. I dont want it to get stuck in some kind of power off/on loop etc..

 

How can I tell it to stop dockers, vms, unmount array etc, then shutdown?

 

Many Thanks!

Link to comment
4 minutes ago, Kilrah said:

Pretty self-explanatory?

 

image.png.6e4f13f48e090bb2b3e6298cc198c5bc.png

 

Yes, this is the setting you'll want. By default NUT initiates a graceful stopping of all services and disks before shutdown. Only if you have a lot of services you might need to increase/fine-tune the shutdown timeout setting under Unraid's Disk Settings to give the OS enough time to stop everything gracefully before it proceeds with the shutdown sequence anyway. A too low shutdown timeout can result in a hard shutdown if the services take longer to stop than the timeout is set, though I'd say this rarely happens with normal use cases.

Link to comment
21 hours ago, Jammy B said:

 

no screen on my basic UPS - https://www.cclonline.com/pc-1000va-powercool-smart-ups-1000va-3-x-uk-plug-2-x-iec-rj45-x-2-usb-led-display/

 

the charging indicator is solid green which means charged and that doesn't change unless i have a powercut or manually kill power to it.

 

it powers my Unraid machine, UDMPRO, switch and CCTV NVR no problem. its never switched off and we don't get many powercuts and when we have its been flawless in signalling the Unraid machine to switch off.

 

its now on 52% charged as well. it was on 3% when i posted this morning

 

image.png.5c3e34a22543549e0085df458b5a9e09.png

 

is there a setting i might have put in to it that it is reading the wrong thing, but what would increase over time?

 

my 3 year old thread - 

 

 

 

 

 

 

 

 

I see you're using these UPS.CONF settings in your old post:

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

 

If you do this then the driver will guess the battery charge based on the battery voltage. Particularly older batteries cannot hold their maximum voltage well anymore and have sags in voltage (possibly causing frequent re-charges). It's possible this mechanism causes your battery to look as "charging" when fluctuations or changes in voltage occur.

 

It's also possible that when the UPS sees an increased load when you start up your server it'll start topping up the battery from a lower voltage to a higher voltage (to ensure providing as much battery time as possible), as opposed to times when the UPS load is minimal and the battery can rest with a lower voltage.

 

Normally the UPS itself provides information about the battery charge, so these settings are not needed and the charge provided is an estimation at best. Please try removing these settings from the UPS.CONF and see if the UPS then provides the actual and not voltage-based estimation of the UPS battery charge.

 

This is in part related to what this user was warning about here in the old topic:

 

Edited by Rysz
Link to comment
9 hours ago, Rysz said:

 

I see you're using these UPS.CONF settings in your old post:

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

 

If you do this then the driver will guess the battery charge based on the battery voltage. Particularly older batteries cannot hold their maximum voltage well anymore and have sags in voltage (possibly causing frequent re-charges). It's possible this mechanism causes your battery to look as "charging" when fluctuations or changes in voltage occur.

 

It's also possible that when the UPS sees an increased load when you start up your server it'll start topping up the battery from a lower voltage to a higher voltage (to ensure providing as much battery time as possible), as opposed to times when the UPS load is minimal and the battery can rest with a lower voltage.

 

Normally the UPS itself provides information about the battery charge, so these settings are not needed and the charge provided is an estimation at best. Please try removing these settings from the UPS.CONF and see if the UPS then provides the actual and not voltage-based estimation of the UPS battery charge.

 

This is in part related to what this user was warning about here in the old topic:

 


removing those 3 lines of code causes NUT to not function. 
 

whilst they aren’t necessarily correct, the config works enough that when on battery it then powers off after 2 minutes. 
 

what do you recommend I do next?

IMG_3566.jpeg

IMG_3567.jpeg

IMG_3565.jpeg

Link to comment
11 minutes ago, Jammy B said:


removing those 3 lines of code causes NUT to not function. 
 

whilst they aren’t necessarily correct, the config works enough that when on battery it then powers off after 2 minutes. 
 

what do you recommend I do next?

IMG_3566.jpeg

IMG_3567.jpeg

IMG_3565.jpeg

 

Hmm, I'm afraid I'm out of my depth with this now. In this case it's probably best to keep those lines then, if the UPS doesn't function otherwise. You could open an issue on GitHub hoping that the NUT driver developers might be able to help you tune your settings some more: https://github.com/networkupstools/nut/issues

 

I'm sorry that I couldn't be of more help here!

Link to comment

Hi All,

 

Over the last few weeks, my NUT plugin was displaying a remaining time left of 0:00:00 (in red) instead of the usual 25min.

 

Since my UPS was 5 years old I changed the battery.

 

After the battery replacement, it was showing again 28min but few hours later, it came back to 0:00:00 (in green).

image.png.b8b122cea3864e3d07671902e280f358.png

 

Any idea what is going on?

 

Thanks!

nut-debug-20240128115505.zip

Link to comment
1 hour ago, mathgoy said:

Hi All,

 

Over the last few weeks, my NUT plugin was displaying a remaining time left of 0:00:00 (in red) instead of the usual 25min.

 

Since my UPS was 5 years old I changed the battery.

 

After the battery replacement, it was showing again 28min but few hours later, it came back to 0:00:00 (in green).

image.png.b8b122cea3864e3d07671902e280f358.png

 

Any idea what is going on?

 

Thanks!

nut-debug-20240128115505.zip 13.07 kB · 0 downloads

 

Did you change anything before this stopped working (UPS firmware update, used another USB port or hub, updated from a much older NUT version, changed the NUT backend, ...)? It looks like the UPS either cannot read, estimate or send the runtime information anymore, because NUT itself receives "battery.runtime: 0" from the UPS. Is the battery you changed to new and properly connected inside the UPS, are there any LED indications that something is not working as it should?

 

Another thing you could try is if the runtime is shown when you disable NUT and use the inbuilt APCUPSD service's "UPS Settings" in UNRAID (just for testing), this way we could better determine if this is a software (NUT/NUT driver) or hardware (UPS/UPS connectivity) problem.

 

Edited by Rysz
Link to comment
On 1/26/2024 at 1:12 PM, Rysz said:

 

Yes, this is the setting you'll want. By default NUT initiates a graceful stopping of all services and disks before shutdown. Only if you have a lot of services you might need to increase/fine-tune the shutdown timeout setting under Unraid's Disk Settings to give the OS enough time to stop everything gracefully before it proceeds with the shutdown sequence anyway. A too low shutdown timeout can result in a hard shutdown if the services take longer to stop than the timeout is set, though I'd say this rarely happens with normal use cases.

 

Thanks. I guess I was thinking there would be more options of sorts to fine tune stopping docker and vms, the array itsself, and shutting down the box. This particular subject (NUT) is kinda sorta new to me so im trying to learn a few things while not frying my rig! :)

 

My initial thinking/worry is that I could lose power while I'm not home and was hoping that the ups would tell unraid to as gracefully as it can stop everything then power off. My bios has options to have the mobo post after power failure etc.. I just dont know in what order it does what. 

Edited by SomeoneOnLine
Link to comment
1 hour ago, SomeoneOnLine said:

that the ups would tell unraid to as gracefully as it can stop everything then power off.

It initiates a shutdown of unraid, and just like if you click the shutdown button in unraid yourself that stops everything as it should.

Edited by Kilrah
  • Like 1
Link to comment
10 hours ago, Kilrah said:

It initiates a shutdown of unraid, and just like if you click the shutdown button in unraid yourself that stops everything as it should.

 

Exactly, and there's not really all that much runtime on most UPS to do fine-grained selective service shutdowns. Important is that everything is gracefully shutdown as intended by UNRAID, which is why the inbuilt graceful shutdown mechanism is used here.

  • Like 1
Link to comment
21 hours ago, Kilrah said:

It initiates a shutdown of unraid, and just like if you click the shutdown button in unraid yourself that stops everything as it should.

HA. Thats good to know. I kinda figured/hoped that by just hitting shutdown it would but never really tested it. but either way its good to know that it will attempt to stop all needed services as cleanly as it can. thanks again for clarification. 

Link to comment

Hello Rysz (and everyone else here), 

 

I seem to be running into a strange issue with NUT. I'm not sure when this started occuring with NUT on my Unraid server, but for some reason, it would not want to run, at least I think it's not running. I enabled the footer and it disappeared. When I go to the NUT settings, and restart NUT, I get an error and it asked me to check syslog. 

 

I also decided to restart unraid to see if that fixed it, and while it did for a the first few minutes where the footer shows up and shows the correct UPS reading, it all of a sudden disappeared and the same issue happened again. 

 

I'm not even sure what to look for or try to do to fix this. I want to avoid rebooting unraid since it takes the server about 4-5 minutes to go through the whole cycle, so if there's any way for me to restart NUT without rebooting, that'll be great. I mean, of course I don't mind rebooting if it's really necessary, I just meant that I don't want to keep rebooting my server.

 

I'm including some screenshots below, along with diagnostic file and nut debug file. Hopefully they can help. 

 

Thank you.

 

 

 

image.thumb.png.87390aa68e790c2ce54b92b48c56b88a.png

 

magi-unraid-diagnostics-20240130-1617.zip

nut-debug-20240130132107.zip

 

image.png

Edited by aquariuz23
Link to comment
8 hours ago, aquariuz23 said:

Hello Rysz (and everyone else here), 

 

I seem to be running into a strange issue with NUT. I'm not sure when this started occuring with NUT on my Unraid server, but for some reason, it would not want to run, at least I think it's not running. I enabled the footer and it disappeared. When I go to the NUT settings, and restart NUT, I get an error and it asked me to check syslog. 

 

I also decided to restart unraid to see if that fixed it, and while it did for a the first few minutes where the footer shows up and shows the correct UPS reading, it all of a sudden disappeared and the same issue happened again. 

 

I'm not even sure what to look for or try to do to fix this. I want to avoid rebooting unraid since it takes the server about 4-5 minutes to go through the whole cycle, so if there's any way for me to restart NUT without rebooting, that'll be great. I mean, of course I don't mind rebooting if it's really necessary, I just meant that I don't want to keep rebooting my server.

 

I'm including some screenshots below, along with diagnostic file and nut debug file. Hopefully they can help. 

 

Thank you.

 

 

 

image.thumb.png.87390aa68e790c2ce54b92b48c56b88a.png

 

magi-unraid-diagnostics-20240130-1617.zip 249.78 kB · 0 downloads

nut-debug-20240130132107.zip 12.52 kB · 1 download

 

image.png

 

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 the USB cable or USB port is dying, hopefully not the USB interface on the USB itself. Can you try with another USB cable or USB port and check if the problem resolves? Configuration-wise everything looks good, so I'm thinking it's something with the physical connection that causes these dropouts - especially since the UPS is recognized at first.

Link to comment
On 1/31/2024 at 1:15 AM, Rysz said:

 

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 the USB cable or USB port is dying, hopefully not the USB interface on the USB itself. Can you try with another USB cable or USB port and check if the problem resolves? Configuration-wise everything looks good, so I'm thinking it's something with the physical connection that causes these dropouts - especially since the UPS is recognized at first.

Hi Rysz, I figured out what I did wrong, but it seem to not have fixed the issue. 

 

I seemed to have accidentally linked the USB connection for the UPS to one of my VMs, which would explain why NUT can no longer see the UPS. However, even after disassociating the UPS from the VM and rebooted my server, NUT's status still shows as Stopped. I'm not sure what else is preventing it from working properly. 

Is there a way to restart the NUT service without having to reboot unraid altogether?

Link to comment
5 minutes ago, aquariuz23 said:

Hi Rysz, I figured out what I did wrong, but it seem to not have fixed the issue. 

 

I seemed to have accidentally linked the USB connection for the UPS to one of my VMs, which would explain why NUT can no longer see the UPS. However, even after disassociating the UPS from the VM and rebooted my server, NUT's status still shows as Stopped. I'm not sure what else is preventing it from working properly. 

Is there a way to restart the NUT service without having to reboot unraid altogether?

 

Of course, just set "Start Network UPS Tools Service" to "Yes" and click on "Apply".

If it is currently set to "Yes": Set it to "No" -> Click "Apply" -> Set it to "Yes" -> Click "Apply".

Please let me know if that worked for you 🙂

 

  • Like 1
Link to comment
14 minutes ago, Rysz said:

 

Of course, just set "Start Network UPS Tools Service" to "Yes" and click on "Apply".

If it is currently set to "Yes": Set it to "No" -> Click "Apply" -> Set it to "Yes" -> Click "Apply".

Please let me know if that worked for you 🙂

 

HAH! How did I completely miss that line? LOL. Thank you so much, and yes it is now working perfectly fine like before :D

 

image.thumb.png.7eb0ccd515f53df2e78848115789b1ed.png

  • Like 1
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.

×
×
  • Create New...