Jump to content
dmacias

[Plugin] NUT v2 - Network UPS Tools

247 posts in this topic Last Reply

Recommended Posts

How does NUT handle a live array during a power outage shutdown? I assume it cleanly stops the array before issuing the shutdown command? Thanks.
It issues the Unraid poweroff command. Does everything as if you powered it off from the webgui.

Share this post


Link to post
24 minutes ago, dmacias said:
7 hours ago, x64 said:
How does NUT handle a live array during a power outage shutdown? I assume it cleanly stops the array before issuing the shutdown command? Thanks.

It issues the Unraid poweroff command. Does everything as if you powered it off from the webgui.

Got it. Can confirm it worked as intended on my cyberpower CP1000PFCLCD when the power went out last night.

Share this post


Link to post

I seem to be getting these errors frequently using this plugin. Any thoughts?

 

Mar 10 10:41:30 Tower usbhid-ups[7138]: nut_libusb_get_string: Pipe error.
Mar 10 10:51:36 Tower usbhid-ups[7138]: nut_libusb_get_report: Input/Output Error.
Mar 10 11:00:08 Tower usbhid-ups[7138]: nut_libusb_get_report: Input/Output Error.

OS: 6.6.7

UPS: CP1000AVRLCDa

Share this post


Link to post

I feel like I'm missing something obvious, but can't manage to configure 2 UPS. Below is what I get when I run autodetect. Any suggestions?

[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0003"
product = "Smart-UPS 750 FW:UPS 03.5 / ID=1015"
serial = "3S1817X16333"
vendor = "American Power Conversion"
bus = "001"
[nutdev2]
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "Eaton 5P"
serial = "G142J48036"
vendor = "EATON"
bus = "001"

Share this post


Link to post
I seem to be getting these errors frequently using this plugin. Any thoughts?
 
Mar 10 10:41:30 Tower usbhid-ups[7138]: nut_libusb_get_string: Pipe error.Mar 10 10:51:36 Tower usbhid-ups[7138]: nut_libusb_get_report: Input/Output Error.Mar 10 11:00:08 Tower usbhid-ups[7138]: nut_libusb_get_report: Input/Output Error.

OS: 6.6.7
UPS: CP1000AVRLCDa

Does it continue to work? I get similar errors. Nut 2.74 would just drop the connect and not reconnect, leaving you unprotected. I compiled the plugin's current version off a different libusb branch and you get errors but it reconnects.

Share this post


Link to post



I feel like I'm missing something obvious, but can't manage to configure 2 UPS. Below is what I get when I run autodetect. Any suggestions?

[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0003"
product = "Smart-UPS 750 FW:UPS 03.5 / ID=1015"
serial = "3S1817X16333"
vendor = "American Power Conversion"
bus = "001"
[nutdev2]
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "Eaton 5P"
serial = "G142J48036"
vendor = "EATON"
bus = "001"


What happens when you run it with the usbhid-ups selected?

Share this post


Link to post
1 hour ago, dmacias said:


 

 


What happens when you run it with the usbhid-ups selected?

 

I only see the APC UPS.

Share this post


Link to post
2 hours ago, dmacias said:
On 3/10/2019 at 1:24 PM, rh535 said:
I seem to be getting these errors frequently using this plugin. Any thoughts?
 


Mar 10 10:41:30 Tower usbhid-ups[7138]: nut_libusb_get_string: Pipe error.Mar 10 10:51:36 Tower usbhid-ups[7138]: nut_libusb_get_report: Input/Output Error.Mar 10 11:00:08 Tower usbhid-ups[7138]: nut_libusb_get_report: Input/Output Error.
 

OS: 6.6.7
UPS: CP1000AVRLCDa

Does it continue to work? I get similar errors. Nut 2.74 would just drop the connect and not reconnect, leaving you unprotected. I compiled the plugin's current version off a different libusb branch and you get errors but it reconnects.

Im pretty sure it works. It shows up in my dashboard saying online, runtime left etc....

Share this post


Link to post
Im pretty sure it works. It shows up in my dashboard saying online, runtime left etc....
If it shows up then it's working. Just a bunch of annoying errors in the log.

Share this post


Link to post
1 minute ago, dmacias said:
23 minutes ago, rh535 said:
Im pretty sure it works. It shows up in my dashboard saying online, runtime left etc....

If it shows up then it's working. Just a bunch of annoying errors in the log.

 

Cool. I'll just ignore the errors then.

Thanks for the help and the plugin!!!

Share this post


Link to post

 

Hi All,

 

Has anyone had any luck getting NUT setup as a server on one unRAID server and then getting other unRAID servers to see it? I tried via USB just to test if NUT would recognize the UPS, no joy with that.

 

I currently have three servers that I would like to utilize the functionality of NUT with.

However, I cannot even get NUT to ‘see’ the UPS (Cyber Power OR2200LCD).

It is supposed to be supported according to the man pages using this driver UPSHID-UPS.

Yes, well, I have little hair left and that was before I started puling it out trying to get this to work.

 

So, if anyone has suggestions on how to get this to work, assume I am an idiot (which I must be since I can’t even get the USB to connection to work) and start from scratch with config-ing NUT (including any drivers that need installed).

 

Thank you all for your continued support to those of us still learning, and to the guys at unRAID for such a great product!

Share this post


Link to post

I have not seen mention of that UPS before, but other CyberPower UPS units (I have a couple myself) work fine with the APC UPS software that comes as part of standard Unraid.    Have you tried that to see if it works with that particular UPS or did you go straight to trying NUT?

Share this post


Link to post
Posted (edited)
10 hours ago, TechMed said:

 

Hi All,

 

Has anyone had any luck getting NUT setup as a server on one unRAID server and then getting other unRAID servers to see it? I tried via USB just to test if NUT would recognize the UPS, no joy with that.

 

I currently have three servers that I would like to utilize the functionality of NUT with.

However, I cannot even get NUT to ‘see’ the UPS (Cyber Power OR2200LCD).

It is supposed to be supported according to the man pages using this driver UPSHID-UPS.

Yes, well, I have little hair left and that was before I started puling it out trying to get this to work.

 

So, if anyone has suggestions on how to get this to work, assume I am an idiot (which I must be since I can’t even get the USB to connection to work) and start from scratch with config-ing NUT (including any drivers that need installed).

 

Thank you all for your continued support to those of us still learning, and to the guys at unRAID for such a great product!

For the USB connected device system, make you actually input/create a UN/PW for your server. This is what my working setup looks like:

image.thumb.png.a0b7ba49f0912208eabd2878ea09dc90.png

 

EDIT: I am working on setting up the server now, something I have been meaning to do for a while now. I already have the process running in server mode, just going through the steps to setup a client. Will update later this weekend.

 

EDIT 2: Actually got it working! Wasn't too bad at all. I will write up a guide later and post it for all, thanks.

Edited by cybrnook

Share this post


Link to post
Posted (edited)

How to setup NUT as a server and client:

 

Server Mode:

On the Unraid host that has the UPS plugged into it, setup your "Server" as follows:

 

-Set UPS mode to Netserver

-Name your UPS, and remember the name as you will need it for client setup

-Use "detect" or choose your connection type. Mine was easy since it's USB.

778547945_NutServer-1.thumb.PNG.885e4865ff3fad512d44cfebd4027154.PNG

 

-In the Config Editor and the bottom of the page, edit your upsd.conf file to reflect two LISTEN entries. Localhost and your unraid IP.

762181466_NutServer-2.PNG.3d310585bd8439b17b37303da19ef30e.PNG I don't think this is needed

 

-Again in the config editor, you can view the default creds in the upsd.users file. Continue to use these or set your own. You will need these again on the Client setup.

252849716_NutServer-3.PNG.9a37294d866a16a481649200c7bb2e17.PNG

 

-Once done, set "Start Network UPS Tools service" to "Yes" and your service should start, and UPS info should be detected and appear.

71952500_NutServer-4.thumb.PNG.41b78c78934611190b47a71ca0f0d54e.PNG

 

-Header at top of page with UPS summary

18706541_NutServer-5.thumb.PNG.3f56ba095eacae519dbe99b9fdce5a28.PNG

 

 

 

 

 

Client Mode:

On the Unraid host that you want to use as a "client", monitoring your server, configure as follows:

 

-Set UPS mode to Slave

-Set the IP of your Primary Unraid server hosting the UPS

-Set the name of the UPS you chose before (Must match case and everything)

-Validate your UN/PW are correct (use the upsd.users file if needed)

*I have slave in there as well, but in actuality, the client defaults to using the Monitor user, not the slave. I believe we could change this by editing the file upsmon.conf directly. But that changes how this guide is written, and make it less easy to follow since it involves setting the client to manual mode only and configuring by hand.*

1611069113_NutClient-1.thumb.PNG.2f307e1af676ac1e80abf93381297aa5.PNG

 

-Once done, set "Start Network UPS Tools service" to "Yes" and your service should start, and UPS info should be detected and appear.

184307598_NutClient-2.thumb.PNG.94b077d35512352059dc04706b77dec5.PNG

 

-Header at top of page with UPS summary

943382493_NutClient-3.thumb.PNG.a596e9168a1627392992ad8b30f87f5d.PNG

 

 

A hint you should keep in mind. Since you may be having multiple devices check into your server, it would be wise to set your servers shutdown timeout to a value that is the largest of all your client devices. That way if your UPS goes to battery mode, the server is there to respond to your clients to shut down. I will be setting my clients to somewhere in the range of 2 min on battery, while my server will be 5 min (even though it appears in the summary page the driver.parameter.pollfreq is set to 30, which I assume is seconds).

Edited by cybrnook
Strike out adding IP's on server side, don't think it's needed if setup properly

Share this post


Link to post

Hi @cybrnook,

 

Wow! Thank you! 👏

 

First, apologies for the late reply; work has been an absolute bear lately.

 

Second, this is exactly what I was hoping for in the way of direction.

 

I do not have the time to implement the instructions right now, but I will re-post the results for others to use too.

 

So, thank you again and I am excited about trying to make this work; I have been struggling with this for a while!

 

Take care

 

Share this post


Link to post

@TechMed

 

I'm switching it up a bit. I actually installed NUT on my pfsense gateway now, and have all my devices ( 2 x unraid and 1 x Synology) all checking in as clients to the gateway now :-). Figure gateway is nonvolatile, and would likely be the last to go down in my rack.

Share this post


Link to post

Having an issue with shutdown message.... My nut clients get the batt low message but never the shutdown... I do get a both notifications on my phone though from the main server via pushbullet.

Turned on local syslog and will do a controlled shutdown later this week but curious if anyone has seen this before? Almost like the server jumps the gun and kills nut before sending out shutdown.

Share this post


Link to post
22 minutes ago, melmurp said:

Almost like the server jumps the gun and kills nut before sending out shutdown.

Disclaimer: I don't use NUT, but perhaps the mechanism is similar to APCUPSD, which I do use. The following is how APCUPSD works.

 

1. Power is lost. Master server running with the UPS directly connected detects outage, starts timer and monitors battery level.

2. Slave units receive power outage notice, start their individual timers, and receive periodic battery level updates from master.

3. Each individual client and master make their own decisions based on their own config files as to when to start the shutdown routine.

 

So, if the clients don't come to the conclusion that it's time to shut down because their individual conditions aren't met before the master shuts down, they will never shut down. They don't rely on the master to signal imminent shutdown, they act on their own conditions, either time on battery or battery level remaining.

 

Personally, all my clients (including server hosted VM's) are set to begin shutdown within 3 minutes of the power out event. The master server waits for 6 minutes, then begins shutdown. Battery backups are best used for as little as possible, preserving the battery level so as not to prematurely wear them out. Discharging below 50% capacity severely shortens lead acid battery life. If you need long runtimes during power outages, you either need a generator to kick in to take over from consumer level backups, or enterprise battery backups with add on extended battery packs.

Share this post


Link to post
2 hours ago, jonathanm said:

Disclaimer: I don't use NUT, but perhaps the mechanism is similar to APCUPSD, which I do use. The following is how APCUPSD works.

 

1. Power is lost. Master server running with the UPS directly connected detects outage, starts timer and monitors battery level.

2. Slave units receive power outage notice, start their individual timers, and receive periodic battery level updates from master.

3. Each individual client and master make their own decisions based on their own config files as to when to start the shutdown routine.

 

So, if the clients don't come to the conclusion that it's time to shut down because their individual conditions aren't met before the master shuts down, they will never shut down. They don't rely on the master to signal imminent shutdown, they act on their own conditions, either time on battery or battery level remaining.

 

Personally, all my clients (including server hosted VM's) are set to begin shutdown within 3 minutes of the power out event. The master server waits for 6 minutes, then begins shutdown. Battery backups are best used for as little as possible, preserving the battery level so as not to prematurely wear them out. Discharging below 50% capacity severely shortens lead acid battery life. If you need long runtimes during power outages, you either need a generator to kick in to take over from consumer level backups, or enterprise battery backups with add on extended battery packs.

Geez, I feel dumb... that's exactly what I was missing.
Need to add EXEC to ONBATT in my client config and put an AT ONBATT timer in upssched.conf so it kicks off a timer then executes the mapped command/script

 

Tks!

Share this post


Link to post

Hi !

 

I have a problem from few time ago.

 

My UPS does not appear anymore on NUT Unraid and NUT pluging always stay on status : Stopped

 

My UPS is a Eaton Evolution S 3000VA  and i have setted up the plugin with : Standalone, usbhid-ups but plugin always stay Stopped

 

Any tip to fix it ?

 

Thanks.

Share this post


Link to post

Hi @cybrnook,

 

Didn't mean to disappear, but a lot transpired over the last few weeks and this has been my first opportunity to look at this again.
 

So, I worked on this a bit, using all of the advice here and some gleaned from other posts, and believe that there are 'pieces' of NUT still floating around after the uninstall. Do you, or anyone, have steps to manually check if all the hidey-holes are cleaned out when BUT is uninstalled?

 

I would like to start there and then begin again; but not until next week as I have to work nights the entire weekend! UGH!

 

I double checked and the Cyber Power OR2200LCD should work fine with the 'Usbhid-ups' driver.

 

Thanks much!!!

 

Share this post


Link to post

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.