Jump to content
dmacias

[Plugin] NUT v2 - Network UPS Tools

244 posts in this topic Last Reply

Recommended Posts

On 4/24/2018 at 4:35 AM, Enigma_swe said:
Hey guys, 
 
I think i found an issue with the rc script.
 
If you have cups installed and running, the pgrep in start_upsd (in /etc/rc.d/rc.nut) will get a hit for cupsd and not start upsd.    pgrep -x should probably work for this case
 
Thanks!

Thanks, I'll fix it.

 

Edit: fixed

Edited by dmacias

Share this post


Link to post

I couldn't use this nut plugin anymore due to usb disconnects with my Tripp Lite on 6.5 kernel and new Supermicro X11 board. My ups did work fine with apcupsd though. I compiled a new version of nut against the libusb1.0+0.1 branch (which is rebased to master) and added a couple patches for timeout, retries and closing connection. I included this new package in the latest release for 6.5 only.

So far my ups had stayed connected for a few days now. I do get this in the log occasionally

usbhid-ups[6380]: nut_libusb_get_report: Input/Output Error

But otherwise it seems to stay connected.

Share this post


Link to post

I can get my trust ups working with NUT if I plugged usb in to my unraid nas, but how can i get it to shutdown my pc which is connected to same trust UPS at the same time? thx David

Share this post


Link to post
4 minutes ago, David McGlynn said:

I can get my trust ups working with NUT if I plugged usb in to my unraid nas, but how can i get it to shutdown my pc which is connected to same trust UPS at the same time? thx David

On unRAID set the Nut UPS Mode to Netserver then install Nut on your PC.  What OS is your PC?

Share this post


Link to post
installed service on pc, so do i need to do anything else?
I don't know how to set it up on windows. But you will need to use client/network slave mode and point to your unRAID server

Share this post


Link to post
9 hours ago, dmacias said:

I couldn't use this nut plugin anymore due to usb disconnects with my Tripp Lite on 6.5 kernel and new Supermicro X11 board. My ups did work fine with apcupsd though. I compiled a new version of nut against the libusb1.0+0.1 branch (which is rebased to master) and added a couple patches for timeout, retries and closing connection. I included this new package in the latest release for 6.5 only.

So far my ups had stayed connected for a few days now. I do get this in the log occasionally

usbhid-ups[6380]: nut_libusb_get_report: Input/Output Error

But otherwise it seems to stay connected.

OMG, does disconnect forever or just a error.

Share this post


Link to post



OMG, does disconnect forever or just a error.


Yes. Tripp Lite Ups, later kennels or motherboard would cause the nut driver to stop working. Once it disconnected it wouldn't reconnect. Had to restart the service but would just stop again. The version of nut I compiled using the libusb 1.0+0.1 branch fixes this but still shows occasional errors in the log.

Share this post


Link to post

hi thank you for this plugin :) 

So I've an ups eaton protection station when I plug it in to an usb port , the plug-in say it's online but cannot read the data of the UPS.

when i connect it to a computer with the eaton compagnion software it's all ok !

So how can I make the plug-in read the data correctly? I tried every usb driver no luck.

 

thank you for assistance

 

this is how unraid sees my ups

Bus 001 Device 004:

ID 0463:ffff MGE UPS Systems UPS

Share this post


Link to post

and this is what happen when I start auto-detect

 

Serveur kernel: usb 1-11: new low-speed USB device number 4 using xhci_hcd
May  6 18:08:48 Serveur kernel: hid-generic 0003:0463:FFFF.0006: hiddev96,hidraw0: USB HID v10.10 Device [EATON Protection Station] on usb-0000:00:14.0-11/input0
May  6 18:08:49 Serveur apcupsd[5248]: Communications with UPS restored.
May  6 18:09:28 Serveur ool www[31797]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:09:58 Serveur ool www[31797]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:15:40 Serveur ool www[1071]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:16:12 Serveur ool www[1063]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:16:41 Serveur ool www[1071]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:16:52 Serveur ool www[602]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:21:51 Serveur ool www[1944]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:22:45 Serveur emhttpd: req (2): cmd=/plugins/nut/scripts/nutscan&csrf_token=****************
May  6 18:22:45 Serveur emhttpd: cmd: /usr/local/emhttp/plugins/nut/scripts/nutscan
May  6 18:23:23 Serveur ool www[2674]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:24:21 Serveur ool www[2705]: /usr/local/emhttp/plugins/nut/scripts/start
May  6 18:24:28 Serveur emhttpd: req (3): cmd=/plugins/nut/scripts/nutscan&csrf_token=****************
May  6 18:24:28 Serveur emhttpd: cmd: /usr/local/emhttp/plugins/nut/scripts/nutscan

Share this post


Link to post
and this is what happen when I start auto-detect
 
Serveur kernel: usb 1-11: new low-speed USB device number 4 using xhci_hcdMay  6 18:08:48 Serveur kernel: hid-generic 0003:0463:FFFF.0006: hiddev96,hidraw0: USB HID v10.10 Device [EATON Protection Station] on usb-0000:00:14.0-11/input0May  6 18:08:49 Serveur apcupsd[5248]: Communications with UPS restored.May  6 18:09:28 Serveur ool www[31797]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:09:58 Serveur ool www[31797]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:15:40 Serveur ool www[1071]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:16:12 Serveur ool www[1063]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:16:41 Serveur ool www[1071]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:16:52 Serveur ool www[602]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:21:51 Serveur ool www[1944]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:22:45 Serveur emhttpd: req (2): cmd=/plugins/nut/scripts/nutscan&csrf_token=****************May  6 18:22:45 Serveur emhttpd: cmd: /usr/local/emhttp/plugins/nut/scripts/nutscanMay  6 18:23:23 Serveur ool www[2674]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:24:21 Serveur ool www[2705]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:24:28 Serveur emhttpd: req (3): cmd=/plugins/nut/scripts/nutscan&csrf_token=****************May  6 18:24:28 Serveur emhttpd: cmd: /usr/local/emhttp/plugins/nut/scripts/nutscan

There's is a problem with autodetect. The -U command parameter was dropped from the latest Nut. You can run /usr/bin/nut-scanner -N from the command line. But I think your problem is the built in UPS service Apcupsd is still running. Do you really need Nut? Does the built in UPS not work for you?

Share this post


Link to post

Does the built-in UPS service APCUPSD support Eaton UPS models? Eaton 5PX1000RT is what I have, but I haven't built my server with unRAID yet, so I'm just wondering if I actually have to use NUT?

Share this post


Link to post

I got NUT working with my Smart-UPS 1400XL 3U in about 5 minutes... does this version of Nut come with a graphing web interface? If not, can anyone recommend a good graphing solution?

 

Another thing, in the UPS driver drop down, I'm surprised there is no option for APCSmart? Considering APC is one of the most popular brands of UPSes, I thought the Web GUI should have that as an option? 

 

Thanks.

Edited by coolspot

Share this post


Link to post
2 hours ago, dmacias said:
2 hours ago, salora said:
and this is what happen when I start auto-detect
 


Serveur kernel: usb 1-11: new low-speed USB device number 4 using xhci_hcdMay  6 18:08:48 Serveur kernel: hid-generic 0003:0463:FFFF.0006: hiddev96,hidraw0: USB HID v10.10 Device [EATON Protection Station] on usb-0000:00:14.0-11/input0May  6 18:08:49 Serveur apcupsd[5248]: Communications with UPS restored.May  6 18:09:28 Serveur ool www[31797]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:09:58 Serveur ool www[31797]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:15:40 Serveur ool www[1071]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:16:12 Serveur ool www[1063]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:16:41 Serveur ool www[1071]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:16:52 Serveur ool www[602]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:21:51 Serveur ool www[1944]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:22:45 Serveur emhttpd: req (2): cmd=/plugins/nut/scripts/nutscan&csrf_token=****************May  6 18:22:45 Serveur emhttpd: cmd: /usr/local/emhttp/plugins/nut/scripts/nutscanMay  6 18:23:23 Serveur ool www[2674]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:24:21 Serveur ool www[2705]: /usr/local/emhttp/plugins/nut/scripts/startMay  6 18:24:28 Serveur emhttpd: req (3): cmd=/plugins/nut/scripts/nutscan&csrf_token=****************May  6 18:24:28 Serveur emhttpd: cmd: /usr/local/emhttp/plugins/nut/scripts/nutscan
 

 

There's is a problem with autodetect. The -U command parameter was dropped from the latest Nut. You can run /usr/bin/nut-scanner -N from the command line. But I think your problem is the built in UPS service Apcupsd is still running. Do you really need Nut? Does the built in UPS not work for you?

thank you for your answer! I forgot there was a buit in ups service ! and indeed it is this one that tell me my ups is online but does not communicate with it . The nut plug in do not start anyway

So i disabled the built in ups service, I ran  /usr/bin/nut-scanner -N and copy the result into the conf editor it do not work better sadly

 

  driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "Protection Station"
        serial = "AN2E49008"
        vendor = "EATON"
        bus = "001"

Share this post


Link to post
On 5/6/2018 at 1:17 PM, salora said:

thank you for your answer! I forgot there was a buit in ups service ! and indeed it is this one that tell me my ups is online but does not communicate with it . The nut plug in do not start anyway

So i disabled the built in ups service, I ran  /usr/bin/nut-scanner -N and copy the result into the conf editor it do not work better sadly

 

  driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "Protection Station"
        serial = "AN2E49008"
        vendor = "EATON"
        bus = "001"

Did you setup in the Nut settings usbhid-ups drive and port auto?

Share this post


Link to post
On 5/6/2018 at 12:14 PM, coolspot said:

I got NUT working with my Smart-UPS 1400XL 3U in about 5 minutes... does this version of Nut come with a graphing web interface? If not, can anyone recommend a good graphing solution?

 

Another thing, in the UPS driver drop down, I'm surprised there is no option for APCSmart? Considering APC is one of the most popular brands of UPSes, I thought the Web GUI should have that as an option? 

 

Thanks.

It's my understanding that if you use usb then APCSmart should use usbhid-ups driver. How do you have it setup?

Share this post


Link to post
15 hours ago, dmacias said:

Did you setup in the Nut settings usbhid-ups drive and port auto?

Yes that's what I did exactly

but nothing displays under nut details and nut setting status is still stopped but the log says :

May  8 16:16:35 Serveur usbhid-ups[1179]: Startup successful
May  8 16:16:36 Serveur upsd[1188]: listening on 0.0.0.0 port 3493
May  8 16:16:36 Serveur upsd[1188]: Connected to UPS [ups]: usbhid-ups-ups
May  8 16:16:36 Serveur upsd[1189]: Startup successful

Share this post


Link to post
6 hours ago, salora said:

Yes that's what I did exactly

but nothing displays under nut details and nut setting status is still stopped but the log says :


May  8 16:16:35 Serveur usbhid-ups[1179]: Startup successful
May  8 16:16:36 Serveur upsd[1188]: listening on 0.0.0.0 port 3493
May  8 16:16:36 Serveur upsd[1188]: Connected to UPS [ups]: usbhid-ups-ups
May  8 16:16:36 Serveur upsd[1189]: Startup successful

 

I just setup my first ups a Eaton 5S via USB and I got it to work with the manual configuration like this from the auto-detect:

driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "5S"
vendor = "EATON"
bus = "005"

 

But I wasn't pleased cause I could choose the usbhid-ups driver in the auto conf but it still didn't work, so I tried to start it via SSH and it always said, you need to name port = in the usp.conf so I went into the editor and did that and started the script via SSH again and same error message so I did that a few times and didn't understand why, until I figured out that I needed to WRITE MANUALLY "auto"  in the auto conf script above where it asks for UPS Port: and that's where you write auto so it will write it into the ups.conf and then it worked.

 

My question to the dev is, why isn't this by default already filled in with auto?

Edited by DexTroN

Share this post


Link to post

I can say that auto is written in the ups.conf but I can't find the auto conf script you're talking about

anyway when I try to lauch the service manually I got this

 

 /etc/rc.d/rc.nut start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
Network UPS Tools - Generic HID driver 0.44 (2.7.4.1)
USB communication driver (libusb 1.0) 0.9
Using subdriver: MGE HID 1.43
Network UPS Tools upsd 2.7.4.1
fopen /var/run/nut/upsd.pid: No such file or directory
listening on 0.0.0.0 port 3493
Connected to UPS [ups]: usbhid-ups-ups
Network UPS Tools upsmon 2.7.4.1
fopen /var/run/nut/upsmon.pid: No such file or directory
/etc/nut/upsmon.conf line 1: invalid directive MONITOR ups@127.0.0.1 1 master
Using power down flag file /etc/nut/no_killpower

Fatal error: insufficient power configured!

Sum of power values........: 0
Minimum value (MINSUPPLIES): 1

Edit your upsmon.conf and change the values.

 

So is that the problem? where an dhow do I configure the power value?

thx

Edited by salora

Share this post


Link to post
 
I just setup my first ups a Eaton 5S via USB and I got it to work with the manual configuration like this from the auto-detect:
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "5S"
vendor = "EATON"
bus = "005"
 
But I wasn't pleased cause I could choose the usbhid-ups driver in the auto conf but it still didn't work, so I tried to start it via SSH and it always said, you need to name port = in the usp.conf so I went into the editor and did that and started the script via SSH again and same error message so I did that a few times and didn't understand why, until I figured out that I needed to WRITE MANUALLY "auto"  in the auto conf script above where it asks for UPS Port: and that's where you write auto so it will write it into the ups.conf and then it worked.
 
My question to the dev is, why isn't this by default already filled in with auto?
The autodetect was broken due to the -U parameter being deprecated for nutscan. After autodtect, the port auto would be added. I had planned to implement more driver specific settings but haven't had time. For now rc.nut will just add auto to any null port value. In the future I would just hide the port field for drivers that don't need it.

Share this post


Link to post

 

 

 

I can say that auto is written in the ups.conf but I can't find the auto conf script you're talking about

anyway when I try to lauch the service manually I got this

 

 /etc/rc.d/rc.nut start

Writing nut config

Updating permissions...

Network UPS Tools - UPS driver controller 2.7.4.1

Network UPS Tools - Generic HID driver 0.44 (2.7.4.1)

USB communication driver (libusb 1.0) 0.9

Using subdriver: MGE HID 1.43

Network UPS Tools upsd 2.7.4.1

fopen /var/run/nut/upsd.pid: No such file or directory

listening on 0.0.0.0 port 3493

Connected to UPS [ups]: usbhid-ups-ups

Network UPS Tools upsmon 2.7.4.1

fopen /var/run/nut/upsmon.pid: No such file or directory

/etc/nut/upsmon.conf line 1: invalid directive MONITOR ups@127.0.0.1 1 master

Using power down flag file /etc/nut/no_killpower

Fatal error: insufficient power configured!

Sum of power values........: 0

Minimum value (MINSUPPLIES): 1

Edit your upsmon.conf and change the values.

 

So is that the problem? where an dhow do I configure the power value?

thx

 

What's your upsmon.conf look like? Looks like line 1 may be missing something

 

Share this post


Link to post

hi, this is the upsmon.conf, it's a fresh install of the plugin 

 

MONITOR ups@127.0.0.1 1   master
SHUTDOWNCMD "/sbin/poweroff"
POWERDOWNFLAG /etc/nut/no_killpower
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYCMD "/usr/sbin/nut-notify"
 

Share this post


Link to post

ok found it

what was missing was that

MONITOR ups@localhost 1 root password master

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.