[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

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.

Link to comment
  • 2 weeks later...

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

Link to comment
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.
Link to comment



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?
Link to comment
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....

Link to comment
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!!!

Link to comment
  • 1 month later...

 

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!

Link to comment

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?

Link to comment
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
Link to comment

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
  • Thanks 1
Link to comment

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

 

Link to comment
  • 2 weeks later...
  • 3 weeks later...

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.

Link to comment
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.

Link to comment
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!

Link to comment
  • 3 weeks later...

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.

Link to comment
  • 2 weeks later...

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!!!

 

Link to comment
  • 1 month later...
  • 3 weeks later...
  • 4 weeks later...

Hi.

Im trying to get a Powercom ups to work, but it seems like im banging my head against a wall.

 

Its a serial attached Powercom BNT 1000AP connected to /dev/ttyS0, but for the love of it i cant get it connected.

 

Anyone that can point me in some sort of direction what to do to get it working?

Link to comment
1 hour ago, Pirate said:

Hi.

Im trying to get a Powercom ups to work, but it seems like im banging my head against a wall.

 

Its a serial attached Powercom BNT 1000AP connected to /dev/ttyS0, but for the love of it i cant get it connected.

 

Anyone that can point me in some sort of direction what to do to get it working?

If I remember correct, a USB to serieal (PL2303 chip type) native support by Unraid, I use this to connect APC UPS in serial previously.

Link to comment
2 minutes ago, Benson said:

If I remember correct, a USB to serieal (PL2303 chip type) native support by Unraid, I use this to connect APC UPS in serial previously.

I did try a USB to serial, but had no luck with either Nut or Native APC UPS.

So i bought a internal com bracket to try to get serial connection to work but no luck with that either.

I got the ups to work in a windows machine with powercom:s own software and the USB to serial cable without any problems.

Everything i try in nut doesn´t work, if i edit the manual config with the values i found online, Nut doesn´t eaven start.

Maybe all the UPS driver isnt in this package only the USB ones?

Accordint to the Nut page, powercom should use custom powercom driver but when i assign it it says:

Tower upsd[5472]: Can't connect to UPS [ups] (powercom-ups): No such file or directory

Link to comment

Hi @Pirate,

 

I realize this is not a direct answer, but I am having similar problems but with a CyberPower unit. I have dome everything but witchcraft to try to make NUT talk to it; including buying the $100 network card. I think it may have something to do with remnants of NUT files, from previous install attempts of NUT, floating around that I cannot find and they need to be removed for a clean reinstall of NUT. I follow this thread so maybe if you find answer, would you be so kind as to post it? I have three servers i would love to use NUT with... but cannot. -Thanks!

  • Like 1
Link to comment
  • Rysz featured this topic

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.