[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

5 hours ago, cassiusdrow said:

I use some commands in my go script that alter dmacias's plugin scripts to use NUT 2.8 and net-snmp 5.9.3 as explained in this post:

Thanks I will review, I am guessing the stock APCUPSD doesn't support what you need hence unsing NUT?

 

net-snmp  is loaded if you install the snmp plugin.

Edited by SimonF
Link to comment
6 hours ago, SimonF said:

I am guessing the stock APCUPSD doesn't support what you need hence unsing NUT?

 

I didn't look at using APCUPSD at all.  I have a lot of time invested in the NUT configuration and I run it in netserver mode for other computers.  Originally, I was using a Cyberpower CST135XLU and switched to the APC SMT1000RM2U after moving the Unraid server to a rack in my basement.  The Cyberpower CST135XLU is now used with a different Unraid server and I prefer the simplicity of using similar UPS control configurations for both servers.  I also monitor both UPSs with telegraf/grafana/influxdb.

 

Replacing the NUT and net-snmp packages while still using dmacias's plugin was the easiest solution.  I think there was a feature in NUT 2.8 that I wanted but I don't remember what it was.  However, the NUT 2.8 package I found is compiled with different locations for the configuration files and process ID file, so I modified the plugin scripts from the go script since it looked unlikely that dmacias would update the plugin.

 

I looked at the changes in your plugin vs dmacias's plugin, and I think my solution will continue to work with your plugin, although I haven't tested it.  I'll switch to your plugin on one of my servers and test it.

Link to comment
27 minutes ago, cassiusdrow said:

 

I didn't look at using APCUPSD at all.  I have a lot of time invested in the NUT configuration and I run it in netserver mode for other computers.  Originally, I was using a Cyberpower CST135XLU and switched to the APC SMT1000RM2U after moving the Unraid server to a rack in my basement.  The Cyberpower CST135XLU is now used with a different Unraid server and I prefer the simplicity of using similar UPS control configurations for both servers.  I also monitor both UPSs with telegraf/grafana/influxdb.

 

Replacing the NUT and net-snmp packages while still using dmacias's plugin was the easiest solution.  I think there was a feature in NUT 2.8 that I wanted but I don't remember what it was.  However, the NUT 2.8 package I found is compiled with different locations for the configuration files and process ID file, so I modified the plugin scripts from the go script since it looked unlikely that dmacias would update the plugin.

 

I looked at the changes in your plugin vs dmacias's plugin, and I think my solution will continue to work with your plugin, although I haven't tested it.  I'll switch to your plugin on one of my servers and test it.

My plugin is a fork, main changes are to add a 6.12 dashboard & php 8 fixes. Will look to update over the next few weeks.

 

Edited by SimonF
  • Like 1
Link to comment

I have a UPS that I've been using for 6 years, it was handling Unraid machine, Windows PC and a Mac. I've upgraded GPU on my PC machine and the UPS is no longer sufficient, so I bought a bigger one. Now having 2 I'd like first one to handle Unraid and the second one to handle the other 2 computers. Both UPSes and Unraid machine are in one room and the PC and Mac are in the office. I have a power line running from one room to another (I've had it installed while renovating so that I don't have to have annoying UPS sound in the office). Now the question is how to get my main PC shut down in case of power failure.

 

So far I was using the Unraid builtin capabilities to communicate with UPS, but now having 2 I thought that the 2nd one can be connected to the NUT plugin, but when I start NUT it always connects to the first one.

 

How can I select which UPS NUT will connect to?

 

Here is output after clicking "Autodetect":

 

[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0002"
product = "Back-UPS XS 1400U FW:926.T1 .I USB FW:T1"
serial = "3B1451X16024"
vendor = "American Power Conversion"
bus = "005"
[nutdev2]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0002"
product = "Back-UPS BX2200MI FW:378700G -302202G"
serial = "9B2221A44604"
vendor = "American Power Conversion"
bus = "005"

 

Link to comment
8 minutes ago, Trylo said:

I have a UPS that I've been using for 6 years, it was handling Unraid machine, Windows PC and a Mac. I've upgraded GPU on my PC machine and the UPS is no longer sufficient, so I bought a bigger one. Now having 2 I'd like first one to handle Unraid and the second one to handle the other 2 computers. Both UPSes and Unraid machine are in one room and the PC and Mac are in the office. I have a power line running from one room to another (I've had it installed while renovating so that I don't have to have annoying UPS sound in the office). Now the question is how to get my main PC shut down in case of power failure.

 

So far I was using the Unraid builtin capabilities to communicate with UPS, but now having 2 I thought that the 2nd one can be connected to the NUT plugin, but when I start NUT it always connects to the first one.

 

How can I select which UPS NUT will connect to?

 

Here is output after clicking "Autodetect":

 

[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0002"
product = "Back-UPS XS 1400U FW:926.T1 .I USB FW:T1"
serial = "3B1451X16024"
vendor = "American Power Conversion"
bus = "005"
[nutdev2]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0002"
product = "Back-UPS BX2200MI FW:378700G -302202G"
serial = "9B2221A44604"
vendor = "American Power Conversion"
bus = "005"

 

Maybe have a small system like a pi to connect to the ups and use nut on it to make available on network. Use slave on the pc to connect to pi?

Link to comment
1 minute ago, SimonF said:

Maybe have a small system like a pi to connect to the ups and use nut on it to make available on network. Use slave on the pc to connect to pi?

It's a good idea, but wouldn't a lightweight Linux VM make more sense and pass through the USB with the 2nd UPS?
I guess this can be my plan B, I'd rather use the NUT plugin.

Link to comment
1 minute ago, Trylo said:

It's a good idea, but wouldn't a lightweight Linux VM make more sense and pass through the USB with the 2nd UPS?
I guess this can be my plan B, I'd rather use the NUT plugin.

Yes could be an option. Would Unraid shutdown and the vm before the pc needs to?

Link to comment
5 minutes ago, SimonF said:

Yes could be an option. Would Unraid shutdown and the vm before the pc needs to?

Good thinking. I'd say it's unlikely. If the PC or Mac is underload for sure not, but if both are ideal it may be close... In this case a RaspberryPi would be safer...

Link to comment
1 minute ago, Trylo said:

@SimonF so are you saying there is no way to set it up using the plugin?

Not sure I would need to look into it. It looks like it is using the USB IDs for Vendor:Product which the same based on config. 

 

I only have a single ups.

 

My ups config is

 

[ups]
driver = nutdrv_qx
port = auto
 

maybe port can be set to a specific usb devices.

Link to comment

I found this in the documentation (https://networkupstools.org/docs/man/usbhid-ups.html😞

"

device = regex

Select a UPS on a specific USB device or group of devices. The argument is a regular expression that must match the device name where the UPS is connected (e.g. device="001" or device="00[1-2]") as seen in /proc/bus/usb/devices or lsusb(8); including leading zeroes. Note that device numbers are not guaranteed by the OS to be stable across re-boots or device re-plugging.

"

My device is:

Bus 005 Device 038 Port 5-1 ID 051d:0002 American Power Conversion Uninterruptible Power Supply

 

So I added device="038" to /etc/nut/ups.conf in Config Editor

 

But upon reloading I got this:

"Duplicate driver instance detected (PID file /var/run/nut/usbhid-ups-ups.pid exists)! Terminating other driver!"

 

 And NUT then reverts back ups.conf to the previous state.

Link to comment

@SimonF Thanks for the work on this plugin

 

After the last update I am getting the following error:

 

root@medusa:~# /usr/local/emhttp/plugins/nut/scripts/start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
/usr/libexec/nut/snmp-ups: error while loading shared libraries: libnetsnmp.so.35: cannot open shared object file: No such file or directory
Driver failed to start (exit status=127)


I found the following

root@medusa:~# find / -iname "libnetsnmp.so*"
/usr/lib64/libnetsnmp.so
/usr/lib64/libnetsnmp.so.30
/usr/lib64/libnetsnmp.so.30.0.3

I then installed:

image.png.e01120cbbcc10a1b269e5a829617648e.png

and now I see the following:

root@medusa:~# find / -iname "libnetsnmp.so*"
/usr/lib64/libnetsnmp.so.40
/usr/lib64/libnetsnmp.so
/usr/lib64/libnetsnmp.so.40.2.0

 

I created a symlink for the library: `ls -s /usr/lib64/libnetsnmp.so.40 /usr/lib64/libnetsnmp.so.35`

 

and now am getting the following:

root@medusa:~# /usr/local/emhttp/plugins/nut/scripts/start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
Network UPS Tools - Generic SNMP UPS driver 1.07 (2.7.4.1)
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No supported device detected
Driver failed to start (exit status=1)

 

The plugins:

image.png.bcfc752f869578e6716b07700bfbd71d.png

 

Link to comment
On 3/29/2023 at 9:13 AM, Clifford W. Hansen said:

@SimonF Thanks for the work on this plugin

 

After the last update I am getting the following error:

 

root@medusa:~# /usr/local/emhttp/plugins/nut/scripts/start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
/usr/libexec/nut/snmp-ups: error while loading shared libraries: libnetsnmp.so.35: cannot open shared object file: No such file or directory
Driver failed to start (exit status=127)


I found the following

root@medusa:~# find / -iname "libnetsnmp.so*"
/usr/lib64/libnetsnmp.so
/usr/lib64/libnetsnmp.so.30
/usr/lib64/libnetsnmp.so.30.0.3

I then installed:

image.png.e01120cbbcc10a1b269e5a829617648e.png

and now I see the following:

root@medusa:~# find / -iname "libnetsnmp.so*"
/usr/lib64/libnetsnmp.so.40
/usr/lib64/libnetsnmp.so
/usr/lib64/libnetsnmp.so.40.2.0

 

I created a symlink for the library: `ls -s /usr/lib64/libnetsnmp.so.40 /usr/lib64/libnetsnmp.so.35`

 

and now am getting the following:

root@medusa:~# /usr/local/emhttp/plugins/nut/scripts/start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
Network UPS Tools - Generic SNMP UPS driver 1.07 (2.7.4.1)
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No supported device detected
Driver failed to start (exit status=1)

 

The plugins:

image.png.bcfc752f869578e6716b07700bfbd71d.png

 

I dont use SNMP, but @cassiusdrowdoes, I am looking to build a test 2.8 + updated SNMP over the weekend which may help.

  • Like 1
Link to comment
On 3/26/2023 at 6:56 PM, cassiusdrow said:

 

Thank you. I appreciate it.

 

I've started using your plugin on both of my servers.  I am using my go script commands to modify it to work with NUT 2.8 and everything runs ok for plugin version 2023.02.14.

Do you run on a single server? or are you using slaves also?

Link to comment
On 3/29/2023 at 9:13 AM, Clifford W. Hansen said:

@SimonF Thanks for the work on this plugin

 

After the last update I am getting the following error:

 

root@medusa:~# /usr/local/emhttp/plugins/nut/scripts/start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
/usr/libexec/nut/snmp-ups: error while loading shared libraries: libnetsnmp.so.35: cannot open shared object file: No such file or directory
Driver failed to start (exit status=127)


I found the following

root@medusa:~# find / -iname "libnetsnmp.so*"
/usr/lib64/libnetsnmp.so
/usr/lib64/libnetsnmp.so.30
/usr/lib64/libnetsnmp.so.30.0.3

I then installed:

image.png.e01120cbbcc10a1b269e5a829617648e.png

and now I see the following:

root@medusa:~# find / -iname "libnetsnmp.so*"
/usr/lib64/libnetsnmp.so.40
/usr/lib64/libnetsnmp.so
/usr/lib64/libnetsnmp.so.40.2.0

 

I created a symlink for the library: `ls -s /usr/lib64/libnetsnmp.so.40 /usr/lib64/libnetsnmp.so.35`

 

and now am getting the following:

root@medusa:~# /usr/local/emhttp/plugins/nut/scripts/start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
Network UPS Tools - Generic SNMP UPS driver 1.07 (2.7.4.1)
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No matching MIB found for sysOID '.1.3.6.1.4.1.8072.3.2.10'!
Please report it to NUT developers, with an 'upsc' output for your device.
Going back to the classic MIB detection method.
No supported device detected
Driver failed to start (exit status=1)

 

The plugins:

image.png.bcfc752f869578e6716b07700bfbd71d.png

 

@cassiusdrow

 

I have created a test 2.8 version  https://raw.githubusercontent.com/SimonFair/NUT-unRAID/master/plugin/nut-2.8.0.plg

 

Only tested on a slave node so far not the netserver one. You will need to remove the orignal plugin to install this version.

 

Error message in logs. Apr  1 12:10:23 GUITest upsmon[11117]: Login on UPS [[email protected]] failed - got [ERR ACCESS-DENIED] but does connect.

 

 

Link to comment
4 hours ago, SimonF said:

@cassiusdrow

 

I have created a test 2.8 version  https://raw.githubusercontent.com/SimonFair/NUT-unRAID/master/plugin/nut-2.8.0.plg

 

Only tested on a slave node so far not the netserver one. You will need to remove the orignal plugin to install this version.

 

Error message in logs. Apr  1 12:10:23 GUITest upsmon[11117]: Login on UPS [[email protected]] failed - got [ERR ACCESS-DENIED] but does connect.

 

 

Thanks @SimonF it's working again 🙂

Link to comment
23 hours ago, SimonF said:

Do you run on a single server? or are you using slaves also?

 

I have two unraid servers, each has its own UPS, and each runs the NUT plugin in netserver mode.  Each unraid server has other computers (not running unraid OS) on the same UPSs, running NUT in netclient (slave) mode and communicating with the unraid servers.

 

 

7 hours ago, SimonF said:

I have created a test 2.8 version  https://raw.githubusercontent.com/SimonFair/NUT-unRAID/master/plugin/nut-2.8.0.plg

 

Only tested on a slave node so far not the netserver one. You will need to remove the orignal plugin to install this version.

 

Thank you.  I'll check it out as soon as I can.  It may be a few days.

Link to comment

Is it possible to check UPS firmware a bit more in depth with usbhid-ups? Mine says "ups.firmware = 264" and that doesn't really tell me anything heh. UPS is HP T1000 G3. It has a reccomended firmware upgrade to bypass false fan fault that randomly can occur and enable faster switching on undervoltage. 

Link to comment
20 minutes ago, Arandomdood said:

Is it possible to check UPS firmware a bit more in depth with usbhid-ups? Mine says "ups.firmware = 264" and that doesn't really tell me anything heh. UPS is HP T1000 G3. It has a reccomended firmware upgrade to bypass false fan fault that randomly can occur and enable faster switching on undervoltage. 

Nut will just report values passed via usb from the device. There may be HP software that may provide more info have you looked at firmware downloads on hp site for update info?

Link to comment
5 minutes ago, SimonF said:

Nut will just report values passed via usb from the device. There may be HP software that may provide more info have you looked at firmware downloads on hp site for update info?

I have indeed. I guess I could shut down NUT and hook up the UPS to a windows laptop real quick to avoid passthru VM within unraid since I'm lazy, but I didn't want to break the NUT connection if not needed yet as I'm not sure if it will be successfully reestablished without a machine restart heh. Never tried it before

Link to comment
11 hours ago, CiscoCoreX said:

Hi,
I'm trying to figure out how to put the right numbers in the driver.parameter.runtimecal: = AAA,100,BBB,50

I have PowerWalker UPS VFI1500 CGPF1

https://powerwalker.com/product/10122109/

 

What is the right value for me, on AAA and BBB ?

 

image.png

 

 

driver.parameter.runtimecal = 180,100,618,50

 

"Full load backup time [min]" = 3.0 * 60 = 180 seconds

"Half load backup time [min]" = 10.3 * 60 = 618 seconds

 

  • Thanks 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.