[Plug-In] NUT - Network UPS Tools


Recommended Posts

Turns out that i´m a moron or blind.

Have no idè why i did not set the ups to turn off after shutdown.

As in "Turn off UPS after shutdown: set to enabled"

 

The shutdown and startup works like it should now.

 

Now only the damn beeping issue is left now!

 

Great to here that it works!!, i cant check right now booth my server and ups is in a box due to moving will moast likely get it setup tomorrow.

 

I played aroud with the beeping myself sometime ago, never got that far to use it after a restart but it worked great when I tested it.

 

Was something like this: (admin/passoword is in the help section of the plugin "top right corner")

upscmd -u "NUT_ADMINUSER" -p "NUT_PASSWORD" ups beeper.disable

 

No idea if it survives reboots.

 

//mace

Link to comment

Have not tried anything yet and is not at home right now but did the upscmd -l ups anyway.

root@Tower:~# upscmd -l ups
Instant commands supported on UPS [ups]:

beeper.disable - Disable the UPS beeper
beeper.enable - Enable the UPS beeper
beeper.mute - Temporarily mute the UPS beeper
beeper.off - Obsolete (use beeper.disable or beeper.mute)
beeper.on - Obsolete (use beeper.enable)
load.off - Turn off the load immediately
load.off.delay - Turn off the load with a delay (seconds)
load.on - Turn on the load immediately
load.on.delay - Turn on the load with a delay (seconds)
shutdown.return - Turn off the load and return when power is back
shutdown.stayoff - Turn off the load and remain off
shutdown.stop - Stop a shutdown in progress

Link to comment

Help in the top right corner i assume is the online manual that leads to networkupstools.

If so where do you find the name/pass? have looked and searched but cant really find any info on that.

The only thing i find is what upsd.users should look like and some example names/passwords that do not work.

 

Also tried searching for upsd.users on unraid when ssh in to ithe box but did not find any upsd.users file.

 

Do i have to create upsd.users file?

And if so where should it be since placing it in the "normal" place (somewhere under etc i assume) would not bring it back after a reboot.

Link to comment

Help in the top right corner i assume is the online manual that leads to networkupstools.

If so where do you find the name/pass? have looked and searched but cant really find any info on that.

The only thing i find is what upsd.users should look like and some example names/passwords that do not work.

 

Also tried searching for upsd.users on unraid when ssh in to ithe box but did not find any upsd.users file.

 

Do i have to create upsd.users file?

And if so where should it be since placing it in the "normal" place (somewhere under etc i assume) would not bring it back after a reboot.

 

Thanks for the output ;)

 

If you click help next to the "feedback" button in the top right corner magic will happen =P and you will find the user/passwords pre coded in the upsd.users file.

 

So no no need to create the file. (it´s in /etc/ups/)

 

Took a while to find the help button myself when I was new to unRAID =P

 

//mace

Link to comment

Ahh THAT help  ::)

Found name/pass and entered the string and got ok so cut power and one short beep came out then no more.

Let unraid and ups shutdown waited around 5min powered up and cut power after unraid was started and the same one beep and no more.

 

Thanks for the help.

 

nice gonna add an option for enable/disable beeper if the ups supports it in the next release.

 

//mace

Link to comment
  • 1 month later...

Thanks macester for putting this together. After a little futzing around I got it to work. I am using an older Best Fortress that uses the serial port to communicate. In configuring the NUT settings I assigned the port to "/dev/tty0" (as is indicated in the help). This locked up the plugin and made the webGui unresponsive. After some poking around I discovered this should be "/dev/ttyS0". All is working great now.

 

Hope this info helps someone.

Link to comment
  • 1 month later...

I'd like to echo my thanks for putting this plugin together. I've been hoping unRAID would eventually support non-APC UPSs for a while now. I was wondering if you'd consider adding the snmp-ups driver in as a dropdown option in the next release? I'm using the plugin with a TrippLite SMART5000RT3U, and this UPS is really only supported by NUT through SNMP using the standard IETF 1.4 MIBs.

 

Because the plugin considers the SNMP driver as "custom", my usb.conf file is missing a couple key parameters every time my server boots. If you could add a dropdown for 'snmp_version' and an editbox for 'community', then we'd have all the variables needed to generate an SNMP config file.

 

Currently to make it work, in my go file I copy a custom usb.conf file to /etc/ups/ with the following contents:

 

[ups]
driver = snmp-ups
port = 192.168.0.31
community = public
snmp_version = v2c
pollfreq = 15
desc = TrippLite SMART5000UPS

 

...and then start the SNMP driver with the command

/usr/bin/snmp-ups -a ups -u root

 

...and everything seems to work nicely.

 

Thanks again.

 

-A

 

 

Link to comment
  • 2 weeks later...

I'd like to echo my thanks for putting this plugin together. I've been hoping unRAID would eventually support non-APC UPSs for a while now. I was wondering if you'd consider adding the snmp-ups driver in as a dropdown option in the next release? I'm using the plugin with a TrippLite SMART5000RT3U, and this UPS is really only supported by NUT through SNMP using the standard IETF 1.4 MIBs.

 

Because the plugin considers the SNMP driver as "custom", my usb.conf file is missing a couple key parameters every time my server boots. If you could add a dropdown for 'snmp_version' and an editbox for 'community', then we'd have all the variables needed to generate an SNMP config file.

 

Currently to make it work, in my go file I copy a custom usb.conf file to /etc/ups/ with the following contents:

 

[ups]
driver = snmp-ups
port = 192.168.0.31
community = public
snmp_version = v2c
pollfreq = 15
desc = TrippLite SMART5000UPS

 

...and then start the SNMP driver with the command

/usr/bin/snmp-ups -a ups -u root

 

...and everything seems to work nicely.

 

Thanks again.

 

-A

 

Sry for the late replay, been enjoying some time off.

 

I will look into it, just some quick questions I guees you would like to be able to choose some sort of "pollfreq" from your example?, havent checked out the snmp-ups driver or your ups does it only support snmp v2 (due to the pullfreq) or v3 for traps?, if it supports v3(the only way i can think a snmp-ups shutdown that times system shutdown is possible) have you tried this with nut or proprietary software?

 

Just want to know before I dig deeper into something that i cant test.

 

//mace

 

PS.  This plugin kinda been onhold due to work but gonna tinker something togheter.

Link to comment
  • 4 weeks later...

I guess now it's my turn to apologize for a delayed reply. :P I didn't see a response for a while, and then sort of stopped tracking this thread ;)

 

The ability to specify a custom value for pollfreq would be nice, you're right. I find the default of 30sec to be a little long.

 

As for SNMP traps, those aren't new to SNMPv3. Main difference between v2c and v3 is the inclusion of security/encryption, which I'm not really interested in on my private network. My UPS supports SNMPv2c, and supports most if not all of the traps defined in the IETF MIB (https://tools.ietf.org/html/rfc1628). I haven't really played around with traps though, since with a polling freq of 15sec and 9000VA of backup capacity, I've got more than enough time to react to a power outage. I just trigger a powerdown when battery capacity reaches 25%, which takes about 45 minutes.

 

Thanks for considering the update. Happy to test/debug for you if that would help.

 

Cheers,

 

-A

Link to comment
  • 1 month later...

 

I have moved away fron unRAID

I will still maintain updades(off nut core package for slackware) but no new develpment will me made

 

 

I'm really sad to see this. I understand that you're not being paid to work on this and no one said you'll do this forever, but can we expect a compatibility update for version 6.2 in the future? Because it doesn't look like 6.2 will get a built-in NUT support, even though it was initially scheduled for that version.

 

Anyway, thank you for all your hard work!

Link to comment
  • 1 month later...

Hi - anyone using this with a CyberPower CP1000PFCLCD? I'm currently using the apcupsd option, but the "Shutdown UPS" is not working quite right. Instead of shutting the UPS down a few minutes after unRAID, it appears to set a 60 min shutdown timer and once that expires if I plug the UPS back into the wall, it does not fire up. If I press and hold the power button on the UPS, it does start and my server then automatically starts thereafter.

 

I should have some time for a few tests soon but I thought I'd reach out in the meantime and ask. The NUT documentation pages I saw seem to indicate this should do what I am looking for.

 

Thx

Link to comment

Hi - anyone using this with a CyberPower CP1000PFCLCD? I'm currently using the apcupsd option, but the "Shutdown UPS" is not working quite right. Instead of shutting the UPS down a few minutes after unRAID, it appears to set a 60 min shutdown timer and once that expires if I plug the UPS back into the wall, it does not fire up. If I press and hold the power button on the UPS, it does start and my server then automatically starts thereafter.

 

I should have some time for a few tests soon but I thought I'd reach out in the meantime and ask. The NUT documentation pages I saw seem to indicate this should do what I am looking for.

 

Thx

Having the UPS not turn itself on automatically once power is restored is likely how you would want it. (or its exactly how I want it)  Depending upon the draw, time on battery, etc the battery may be flat, and power when its restored has a very good chance of going out almost immediately again in which case the UPS may not even be able to power up the system long enough for the plugins to get back up and running so that they can tell the system to shut itself off again.
Link to comment

Thanks for the feedback. I have now installed and tested the NUT plugin with my CyberPower CP1000PFCLCD unit (twice). It appears to work flawlessly. Got a notification from unRAID when I pulled the UPS power from the wall, then another notification 3 minutes later stating that unRAID was shutting down. Once the server halted, my UPS shut itself off just as I had hoped (with more than ~20 min estimated runtime left).

 

I waited a few minutes and plugged the UPS back in simulating power restore. My UPS kicked on and showed a 10 second timer before it re-enabled power to my server (I may look to see if I can extend that to 30 seconds). Upon getting power, my server turned back on and was ready for me to manually start the array after 1-2 minutes. Shutdown was clean and no parity check required. I run hardly any plugins and 0 dockers on this server, if your situation is different this might not be for you.

 

My intention here is that if I am away from home and we lose power for a couple hours at the beginning of the trip, I want to be able to connect in to my lan through a SSH tunnel and start my array so I can resume watching my content. I've had two instances over the last few years where we were on a week+ vacation and a brief power outage resulted in not being able to watch Plex for the remainder of the trip. As long as I don't let my server run the UPS battery down too much prior to shutdown, I think it'll work without too much risk.

 

Thanks again for creating this awesome plugin! I wonder/hope if the source could be formally adopted by limetech in a future release. Having the choice between apcupsd and NUT should allow just about all UPS to work w/o issue.

 

Here's a screenshot of my settings in case anyone else has this or it's sister models with higher/lower capacity.

 

uPMpvkJ.png

Link to comment
  • 3 weeks later...

Thanks for the feedback. I have now installed and tested the NUT plugin with my CyberPower CP1000PFCLCD unit (twice). It appears to work flawlessly. Got a notification from unRAID when I pulled the UPS power from the wall, then another notification 3 minutes later stating that unRAID was shutting down. Once the server halted, my UPS shut itself off just as I had hoped (with more than ~20 min estimated runtime left).

 

I waited a few minutes and plugged the UPS back in simulating power restore. My UPS kicked on and showed a 10 second timer before it re-enabled power to my server (I may look to see if I can extend that to 30 seconds). Upon getting power, my server turned back on and was ready for me to manually start the array after 1-2 minutes. Shutdown was clean and no parity check required. I run hardly any plugins and 0 dockers on this server, if your situation is different this might not be for you.

 

My intention here is that if I am away from home and we lose power for a couple hours at the beginning of the trip, I want to be able to connect in to my lan through a SSH tunnel and start my array so I can resume watching my content. I've had two instances over the last few years where we were on a week+ vacation and a brief power outage resulted in not being able to watch Plex for the remainder of the trip. As long as I don't let my server run the UPS battery down too much prior to shutdown, I think it'll work without too much risk.

 

Thanks again for creating this awesome plugin! I wonder/hope if the source could be formally adopted by limetech in a future release. Having the choice between apcupsd and NUT should allow just about all UPS to work w/o issue.

 

Here's a screenshot of my settings in case anyone else has this or it's sister models with higher/lower capacity.

 

uPMpvkJ.png

 

Hi Brian,

 

I have the same ups and was having the same issue of the ups not shutting down with the apcupsd plugin. It's good to hear that this plugin works properly.

 

Another user on here and I also discovered (the hard way) that this ups did something else that was pretty bad. If the battery was run down a bit and it is charging when the power is back and the server is on, the moment the battery is full and it switches from charging to pass through, it cuts the power momentarily, causing the server to shut off uncleanly.

 

Did you ever test that? The other user claimed it only happened when he tried the option "shut down the ups" with the other plugin but I'm not sure. It happened to me after a power outage, where I found the server off several hours after the power was restored and I was perplexed. Later, I tested it with the following:

1) I unplugged the ups, let the server shutdown cleanly.

2) Run the ups battery down to 80% (with a lamp hooked up).

3) Restored power to the ups.

4) Started the server (array off)

5) Watched the server shut off when the battery got full.

 

I don't have too many outages (maybe once a year). So what I had been doing is, wait until the ups is fully charged before starting the server but it is very annoying.

Link to comment

 

Hi Brian,

 

I have the same ups and was having the same issue of the ups not shutting down with the apcupsd plugin. It's good to hear that this plugin works properly.

 

Another user on here and I also discovered (the hard way) that this ups did something else that was pretty bad. If the battery was run down a bit and it is charging when the power is back and the server is on, the moment the battery is full and it switches from charging to pass through, it cuts the power momentarily, causing the server to shut off uncleanly.

 

Did you ever test that? The other user claimed it only happened when he tried the option "shut down the ups" with the other plugin but I'm not sure. It happened to me after a power outage, where I found the server off several hours after the power was restored and I was perplexed. Later, I tested it with the following:

1) I unplugged the ups, let the server shutdown cleanly.

2) Run the ups battery down to 80% (with a lamp hooked up).

3) Restored power to the ups.

4) Started the server (array off)

5) Watched the server shut off when the battery got full.

 

I don't have too many outages (maybe once a year). So what I had been doing is, wait until the ups is fully charged before starting the server but it is very annoying.

 

Hello @aptalca, thanks for reaching out.

 

I did not test what you describe above using apcupsd but would be very curious to hear the results of the same test using NUT. My plate is pretty full for a while with other projects, but if I get an opportunity to do a proper test as you've laid out above with NUT, I'll be sure to post back with my results. Likewise, if you make the switch, let me know how it goes! That's a pretty awful scenario you've described, I'm curious to find out what happens with NUT.

 

 

Thanks

-Brian

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.