Jump to content

[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

On 5/15/2024 at 6:37 PM, tmodev said:

Hello guys,

Does anyone of you run NetworkUPS Tools with the PeaNUT Homepage integration?  I had it working in the past when i was trying out an ACP UPS. However, with my Cyberpower UPS (way lower idle draw from the UPS itself) I cannot get this widget to work. 

 

Any ideas what i might have configured wrong?

https://gethomepage.dev/latest/widgets/services/peanut/

 

      - tmoUPS:
            icon: https://cdn-icons-png.flaticon.com/512/2138/2138730.png
            description: tmo UPS
            siteMonitor: http://192.168.178.200:9990
            statusStyle: "dot"
            widget:
                type: peanut
                url: http://192.168.178.200:9990
                key: ups
                fields: ["battery_charge", "ups_load", "ups_status"]


grafik.png.39dae29a1fcaa1537a5357dc4b49d4ea.png

grafik.png

 

Apparently you don't just need the widget, you also need the PeaNUT program running. "This widget requires an additional tool, PeaNUT, as noted. Other projects exist to achieve similar results using a customapi widget, for example NUTCase." => https://github.com/Brandawg93/PeaNUT

Link to comment

The SNMP address in the image is 192.168.50.199, and SNMP has been configured. However, I can't enable it in Unraid. I suspect it's due to incorrect settings, but I haven't been able to find the reason.

At the same time, I found in the Hardware Compatibility List that the Huawei UPS5000-E supports the SNMP-UPS driver, while my UPS2000-A series only supports the Huawei-UPS2000 driver.

1.png

2.png

Link to comment
Posted (edited)
8 minutes ago, dicry said:

The SNMP address in the image is 192.168.50.199, and SNMP has been configured. However, I can't enable it in Unraid. I suspect it's due to incorrect settings, but I haven't been able to find the reason.

At the same time, I found in the Hardware Compatibility List that the Huawei UPS5000-E supports the SNMP-UPS driver, while my UPS2000-A series only supports the Huawei-UPS2000 driver.

1.png

2.png


Can you try put the as the UPS Driver Port: 192.168.50.199:161

Then set Start Network UPS Tools Service to No --> Apply --> Yes --> Apply

If it doesn't work then please post the relevant SYSLOG lines so I can see what NUT does... 🙂

 

Also please download the MIB file from that page and post it here, so I can see if it is NUT compatible!

 

Edited by Rysz
Link to comment

May 22 13:38:49 Tower rc.nut: Writing NUT configuration...
May 22 13:39:27 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 13:41:04 Tower rc.nut: Updating permissions for NUT...
May 22 13:41:04 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 13:41:04 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 13:41:05 Tower rc.nut: Stopping the NUT services... 
May 22 13:41:07 Tower rc.nut: Can't open /var/run/nut/snmp-ups-ups.pid: No such file or directory
May 22 13:41:07 Tower rc.nut: Can't open /var/run/nut/snmp-ups-192.168.50.199.pid either: No such file or directory
May 22 13:41:07 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 13:42:56 Tower ool www[1692]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 13:42:56 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 13:42:56 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 13:42:57 Tower rc.nut: Writing NUT configuration...
May 22 13:43:28 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 13:45:12 Tower rc.nut: Updating permissions for NUT...
May 22 13:45:12 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 13:45:12 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 13:45:58 Tower rc.nut: Startup timer elapsed, continuing...
May 22 13:45:58 Tower rc.nut: Driver [ups] PID 26668 initially exceeded maxstartdelay and is still starting
May 22 13:45:58 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 13:49:14 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199)
May 22 13:49:14 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)
May 22 13:57:59 Tower ool www[15025]: /usr/local/emhttp/plugins/nut-dw/scripts/stop
May 22 13:58:00 Tower rc.nut: Writing NUT configuration...
May 22 13:58:30 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:00:17 Tower rc.nut: Updating permissions for NUT...
May 22 14:00:17 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:00:17 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:00:18 Tower rc.nut: Stopping the NUT services... 
May 22 14:00:20 Tower rc.nut: Can't open /var/run/nut/snmp-ups-ups.pid: No such file or directory
May 22 14:00:20 Tower rc.nut: Can't open /var/run/nut/snmp-ups-192.168.50.199.pid either: No such file or directory
May 22 14:00:20 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:18:45 Tower ool www[5571]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 14:18:45 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 14:18:45 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 14:18:46 Tower rc.nut: Writing NUT configuration...
May 22 14:19:32 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:19:47 Tower dhcpcd[2490]: bond1: failed to renew DHCP, rebinding
May 22 14:19:47 Tower dhcpcd[2490]: bond1: leased 192.168.50.109 for 7200 seconds
May 22 14:20:32 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:21:01 Tower rc.nut: Updating permissions for NUT...
May 22 14:21:01 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:21:01 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:21:47 Tower rc.nut: Startup timer elapsed, continuing...
May 22 14:21:47 Tower rc.nut: Driver [ups] PID 27409 initially exceeded maxstartdelay and is still starting
May 22 14:21:47 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:25:02 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199)
May 22 14:25:02 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)
May 22 14:39:25 Tower ool www[22665]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 14:39:25 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 14:39:25 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 14:39:26 Tower rc.nut: Writing NUT configuration...
May 22 14:39:34 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:41:34 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:41:40 Tower rc.nut: Updating permissions for NUT...
May 22 14:41:40 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:41:40 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:42:26 Tower rc.nut: Startup timer elapsed, continuing...
May 22 14:42:26 Tower rc.nut: Driver [ups] PID 1311 initially exceeded maxstartdelay and is still starting
May 22 14:42:26 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:45:41 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199)
May 22 14:45:41 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)
May 22 14:46:27 Tower ool www[27261]: /usr/local/emhttp/plugins/nut-dw/scripts/stop
May 22 14:46:28 Tower rc.nut: Writing NUT configuration...
May 22 14:46:34 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:48:46 Tower rc.nut: Updating permissions for NUT...
May 22 14:48:46 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:48:46 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:48:47 Tower rc.nut: Stopping the NUT services... 
May 22 14:48:49 Tower rc.nut: Can't open /var/run/nut/snmp-ups-ups.pid: No such file or directory
May 22 14:48:49 Tower rc.nut: Can't open /var/run/nut/snmp-ups-192.168.50.199:161.pid either: No such file or directory
May 22 14:48:49 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:49:01 Tower ool www[14930]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 14:49:01 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 14:49:01 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 14:49:02 Tower rc.nut: Writing NUT configuration...
May 22 14:49:35 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:51:15 Tower rc.nut: Updating permissions for NUT...
May 22 14:51:15 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:51:15 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:52:01 Tower rc.nut: Startup timer elapsed, continuing...
May 22 14:52:01 Tower rc.nut: Driver [ups] PID 31670 initially exceeded maxstartdelay and is still starting
May 22 14:52:01 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:55:17 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199:161)
May 22 14:55:17 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)

 

This is a log, and the MIB file is attached for your reference. I am currently using 192.168.50.199:161 but still unable to connect.

UPS-RFC1628-MIB.zip

Link to comment
Posted (edited)
On 5/22/2024 at 9:01 AM, dicry said:

May 22 13:38:49 Tower rc.nut: Writing NUT configuration...
May 22 13:39:27 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 13:41:04 Tower rc.nut: Updating permissions for NUT...
May 22 13:41:04 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 13:41:04 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 13:41:05 Tower rc.nut: Stopping the NUT services... 
May 22 13:41:07 Tower rc.nut: Can't open /var/run/nut/snmp-ups-ups.pid: No such file or directory
May 22 13:41:07 Tower rc.nut: Can't open /var/run/nut/snmp-ups-192.168.50.199.pid either: No such file or directory
May 22 13:41:07 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 13:42:56 Tower ool www[1692]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 13:42:56 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 13:42:56 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 13:42:57 Tower rc.nut: Writing NUT configuration...
May 22 13:43:28 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 13:45:12 Tower rc.nut: Updating permissions for NUT...
May 22 13:45:12 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 13:45:12 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 13:45:58 Tower rc.nut: Startup timer elapsed, continuing...
May 22 13:45:58 Tower rc.nut: Driver [ups] PID 26668 initially exceeded maxstartdelay and is still starting
May 22 13:45:58 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 13:49:14 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199)
May 22 13:49:14 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)
May 22 13:57:59 Tower ool www[15025]: /usr/local/emhttp/plugins/nut-dw/scripts/stop
May 22 13:58:00 Tower rc.nut: Writing NUT configuration...
May 22 13:58:30 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:00:17 Tower rc.nut: Updating permissions for NUT...
May 22 14:00:17 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:00:17 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:00:18 Tower rc.nut: Stopping the NUT services... 
May 22 14:00:20 Tower rc.nut: Can't open /var/run/nut/snmp-ups-ups.pid: No such file or directory
May 22 14:00:20 Tower rc.nut: Can't open /var/run/nut/snmp-ups-192.168.50.199.pid either: No such file or directory
May 22 14:00:20 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:18:45 Tower ool www[5571]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 14:18:45 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 14:18:45 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 14:18:46 Tower rc.nut: Writing NUT configuration...
May 22 14:19:32 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:19:47 Tower dhcpcd[2490]: bond1: failed to renew DHCP, rebinding
May 22 14:19:47 Tower dhcpcd[2490]: bond1: leased 192.168.50.109 for 7200 seconds
May 22 14:20:32 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:21:01 Tower rc.nut: Updating permissions for NUT...
May 22 14:21:01 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:21:01 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:21:47 Tower rc.nut: Startup timer elapsed, continuing...
May 22 14:21:47 Tower rc.nut: Driver [ups] PID 27409 initially exceeded maxstartdelay and is still starting
May 22 14:21:47 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:25:02 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199)
May 22 14:25:02 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)
May 22 14:39:25 Tower ool www[22665]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 14:39:25 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 14:39:25 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 14:39:26 Tower rc.nut: Writing NUT configuration...
May 22 14:39:34 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:41:34 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:41:40 Tower rc.nut: Updating permissions for NUT...
May 22 14:41:40 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:41:40 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:42:26 Tower rc.nut: Startup timer elapsed, continuing...
May 22 14:42:26 Tower rc.nut: Driver [ups] PID 1311 initially exceeded maxstartdelay and is still starting
May 22 14:42:26 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:45:41 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199)
May 22 14:45:41 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)
May 22 14:46:27 Tower ool www[27261]: /usr/local/emhttp/plugins/nut-dw/scripts/stop
May 22 14:46:28 Tower rc.nut: Writing NUT configuration...
May 22 14:46:34 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:48:46 Tower rc.nut: Updating permissions for NUT...
May 22 14:48:46 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:48:46 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:48:47 Tower rc.nut: Stopping the NUT services... 
May 22 14:48:49 Tower rc.nut: Can't open /var/run/nut/snmp-ups-ups.pid: No such file or directory
May 22 14:48:49 Tower rc.nut: Can't open /var/run/nut/snmp-ups-192.168.50.199:161.pid either: No such file or directory
May 22 14:48:49 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:49:01 Tower ool www[14930]: /usr/local/emhttp/plugins/nut-dw/scripts/start
May 22 14:49:01 Tower rc.nut: WARNING: NUT was user-configured to disable power management for all USB devices.
May 22 14:49:01 Tower rc.nut: WARNING: NUT is now forcing all USB devices to permanent [on] power state as requested...
May 22 14:49:02 Tower rc.nut: Writing NUT configuration...
May 22 14:49:35 Tower flash_backup: adding task: /usr/local/emhttp/plugins/dynamix.my.servers/scripts/UpdateFlashBackup update
May 22 14:51:15 Tower rc.nut: Updating permissions for NUT...
May 22 14:51:15 Tower rc.nut: Checking if the NUT Runtime Statistics Module should be enabled...
May 22 14:51:15 Tower rc.nut: Enabling the NUT Runtime Statistics Module...
May 22 14:52:01 Tower rc.nut: Startup timer elapsed, continuing...
May 22 14:52:01 Tower rc.nut: Driver [ups] PID 31670 initially exceeded maxstartdelay and is still starting
May 22 14:52:01 Tower rc.nut: Network UPS Tools - UPS driver controller 2.8.2
May 22 14:55:17 Tower rc.nut: No supported device detected at [ups] (host 192.168.50.199:161)
May 22 14:55:17 Tower rc.nut: Network UPS Tools - Generic SNMP UPS driver 1.31 (2.8.2)

 

This is a log, and the MIB file is attached for your reference. I am currently using 192.168.50.199:161 but still unable to connect.

UPS-RFC1628-MIB.zip 7.46 kB · 0 downloads

 

It should work with your UPS because it uses the RFC standard.

Can you try changing the settings as follows:

 

grafik.png.3ea0beb8b5c2ddb7356d427bf281b85b.png

 

 

grafik.thumb.png.03be2bd843b6e6ca3fcb2f3ace5fe2db.png

 

 

If this doesn't work, please run these commands and post the results:

nut-scanner -S -s 192.168.50.198 -e 192.168.50.200 -c public0
nut-scanner -S -s 192.168.50.198 -e 192.168.50.200 -c private0
nut-scanner -S -s 192.168.50.198 -e 192.168.50.200

 

Last resort, check out this Chinese guide I found for your UPS with SNMP:

https://post.smzdm.com/p/adm62dkk/

 

They got it working with SNMPv3. It should definitely work with SNMPv1/SNMPv2 also, but in the worst case you can try the guide from this post and use SNMPv3 (which is far more complicated, but also more secure).

 

Please let me know what worked for you in the end!

 

Edited by Rysz
Link to comment

According to your instructions, it is now running normally, but I cannot see: NOMINAL POWER UPS LOAD UPS LOAD POWER FACTOR information.

At the same time, according to the web page you provided, V3 can also run normally.

But currently only the SNMP method is most suitable for my working style.
Is there any way to improve it?

2024-05-24_111443.png

Link to comment

Hello, glad you got it working with SNMP.

There is not really a way to improve the values being read, as that is hard-coded into the driver.

 

Can you try adding this setting and see if anything improves?

grafik.thumb.png.6cd0dd0e11e598d4e86a3b9ab0b6d84e.png

Link to comment
Posted (edited)
On 5/20/2024 at 8:31 PM, PilaScat said:

Any news for the APC Back-UP UPS?

image.png.99914ae42e0fdd3e774f21cade10be3e.png

After reboot it works for some time, then freeze

image.thumb.png.ab9a1396ae81de86d20818d872d38abd.png

Tried with usb power override without succes

EDIT: Saw the post about APC, resetted config, will see about freezing

 

nut-debug-20240520202951.zip 258.73 kB · 0 downloads

 

Sorry, there's no news on that. It's still a known issue both with APCUPSD and NUT that is likely related to the UPS firmware being different or broken somehow (which in my opinion is the more likely scenario). Again, in my personal opinion, it's a very low quality production UPS (which does make sense at that price) that I personally wouldn't trust to protect my devices in its current state. I've read not many really positive reviews about it either so far, apart from the price point. I think the only option, if it's still new, is to try to return it for another better (APC, ...) model or series that's known to be working better with NUT. This is my personal opinion and not that of the NUT developers.

 

Edited by Rysz
Link to comment
Posted (edited)
10 minutes ago, dicry said:

Now I can see UPS LOAD, but it is still incomplete.

5.png

 

That's great, because from UPS Load the other missing variables can be calculated.

 

Now set these settings:

grafik.png.b7aa45d63a64d616efbf082b9df4d307.png

 

Instead of 0 put here the nominal 2000VA and 1600W of your UPS and you should see the other variables now 🙂

 

Edited by Rysz
Link to comment
Posted (edited)

Thank you very much, it displays perfectly now.
I get an immediate response from you every time.
grateful! ! !  
This is the best community of developers I've come across since using unraid!

🤝🤝🤝

4.png

Edited by dicry
  • Thanks 1
Link to comment

Hi, I am running the NUT plugin as a slave on my Unraid machine (the UPS is connected to a different machine running NUT server).  Everything seems to work on the Unraid slave, except it won't power down.  It tries to shut down, but then throws an error:

 

May 31 08:24:56 Tower upsmon[3379]: UPS [email protected] on battery
May 31 08:24:56 Tower nut-notify: [office-ups] UPS is on battery. The system will shutdown when the UPS battery charge reaches 80%.
May 31 08:24:56 Tower nut-notify: [office-ups] UNRAID is being gracefully shutdown from a UPS power event.
May 31 08:24:56 Tower upsmon[3379]: Signal 10: User requested FSD
May 31 08:24:56 Tower upsmon[3379]: Executing automatic power-fail shutdown
May 31 08:24:56 Tower upsmon[3379]: Auto logout and shutdown proceeding
May 31 08:25:01 Tower upsmon[3379]: Unable to call shutdown command: (null)

 

Any idea what is causing this?  Thanks in advance.

Link to comment
3 hours ago, MastodonFarm said:

Hi, I am running the NUT plugin as a slave on my Unraid machine (the UPS is connected to a different machine running NUT server).  Everything seems to work on the Unraid slave, except it won't power down.  It tries to shut down, but then throws an error:

 

May 31 08:24:56 Tower upsmon[3379]: UPS [email protected] on battery
May 31 08:24:56 Tower nut-notify: [office-ups] UPS is on battery. The system will shutdown when the UPS battery charge reaches 80%.
May 31 08:24:56 Tower nut-notify: [office-ups] UNRAID is being gracefully shutdown from a UPS power event.
May 31 08:24:56 Tower upsmon[3379]: Signal 10: User requested FSD
May 31 08:24:56 Tower upsmon[3379]: Executing automatic power-fail shutdown
May 31 08:24:56 Tower upsmon[3379]: Auto logout and shutdown proceeding
May 31 08:25:01 Tower upsmon[3379]: Unable to call shutdown command: (null)

 

Any idea what is causing this?  Thanks in advance.

 

Please post the NUT Debug Package found on NUT Settings page.

Link to comment
Posted (edited)
8 hours ago, MastodonFarm said:

 

Your configuration is malformed and missing the shutdown command directive.

 

The best course of action would be to "Reset Config" on NUT Settings page and set up NUT again through only the GUI settings on NUT Settings page, that will make sure your configuration is 100% fine and not missing anything (you can confirm the SHUTDOWNCMD directive exists in UPSMON.CONF after).

 

Alternatively edit the UPSMON.CONF with the GUI configuration editor on NUT Settings Page.

 

Line 2 to 7 of UPSMON.CONF right now is:

POWERDOWNFLAG "/etc/nut/no_killpower"
POWERDOWNFLAG "/etc/nut/no_killpower"
NOTIFYCMD "/usr/sbin/nut-notify"
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
(empty line)

 

Line 2 to 7 of UPSMON.CONF should actually be (change it to this):

SHUTDOWNCMD "/sbin/poweroff"
POWERDOWNFLAG "/etc/nut/no_killpower"
NOTIFYCMD "/usr/sbin/nut-notify"
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYFLAG REPLBATT SYSLOG+EXEC

 

The SHUTDOWNCMD tells NUT what command to use to shutdown the system.

Make sure to put it on line 2, as line 3 is overwritten with the POWERDOWNFLAG.

 

Restart NUT to apply; you can then test if a NUT shutdown works now using (this will shutdown for real):

upsmon -c fsd

 

Please let me know if that solved the problem you are experiencing 🙂 

 

Edited by Rysz
Link to comment
Posted (edited)

Thank you!  Resetting the config and doing it all auto fixed the problem.  Really appreciate the help, and thanks for maintaining this awesome plugin.

 

FWIW, I initially tried to set it up manually because I had an underscore in my UPS name and other special characters in my password--which worked fine on my NUT server and other client boxes, but not with the Unraid plugin. The manual configuration didn't work, so I went back and removed the underscore from my UPS name (which required reconfiguration on all my other boxes) and added an unraiduser without special characters in the password. 

 

I don't know if accepting special characters is on your roadmap for the plugin, but I'm sure it would help people like me who are using it to add an Unraid box to an existing NUT setup that uses special characters (I mean, it's an established best practice to include them in passwords).

Edited by MastodonFarm
Link to comment
Posted (edited)
On 6/1/2024 at 3:54 PM, MastodonFarm said:

Thank you!  Resetting the config and doing it all auto fixed the problem.  Really appreciate the help, and thanks for maintaining this awesome plugin.

 

FWIW, I initially tried to set it up manually because I had an underscore in my UPS name and other special characters in my password--which worked fine on my NUT server and other client boxes, but not with the Unraid plugin. The manual configuration didn't work, so I went back and removed the underscore from my UPS name (which required reconfiguration on all my other boxes) and added an unraiduser without special characters in the password. 

 

I don't know if accepting special characters is on your roadmap for the plugin, but I'm sure it would help people like me who are using it to add an Unraid box to an existing NUT setup that uses special characters (I mean, it's an established best practice to include them in passwords).

 

Glad it works now, it's on the to-do list and not hard to implement. I just haven't found that much time to work on the plugin recently and my priority was getting everything on track and working for the Unraid 6.13/7.0 release.

 

Edited by Rysz
Link to comment

Still struggling with random disconnects of a CYBERPOWER BR700ELCD.

 

I tried adding the pollonly flag, as suggested on the manual page: https://networkupstools.org/docs/man/usbhid-ups.html, but this did not help.

 

I realise this is not an Unraid/NUT issue, but wondering if anyone has any other suggestions?

 

The disconnects are completely random - sometimes it goes weeks, other times only a day. And I have to unplug/replug the USB cable to get it to work again (a restart of NUT does not help).

 

Jun  3 16:14:43 SM1 usbhid-ups[19008]: nut_libusb_get_report: Input/Output Error
Jun  3 16:14:43 SM1 kernel: usb 2-2.1: USB disconnect, device number 41
Jun  3 16:14:45 SM1 kernel: usb 2-2.1: new low-speed USB device number 42 using uhci_hcd
Jun  3 16:14:46 SM1 kernel: hid-generic 0003:0764:0501.0028: hiddev96,hidraw1: USB HID v1.10 Device [CPS BR700ELCD] on usb-0000:02:00.0-2.1/
input0
Jun  3 16:14:53 SM1 kernel: usb 2-2.1: USB disconnect, device number 42
Jun  3 16:14:56 SM1 usbhid-ups[19008]: libusb1: Could not open any HID devices: insufficient permissions on everything
Jun  3 16:14:56 SM1 upsd[19125]: Data for UPS [ups] is stale - check driver
Jun  3 16:14:57 SM1 kernel: usb 2-2.1: new low-speed USB device number 43 using uhci_hcd
Jun  3 16:14:58 SM1 kernel: hid-generic 0003:0764:0501.0029: hiddev96,hidraw1: USB HID v1.10 Device [CPS BR700ELCD] on usb-0000:02:00.0-2.1/
input0
Jun  3 16:14:59 SM1 upsmon[19129]: Poll UPS [[email protected]] failed - Data stale
Jun  3 16:14:59 SM1 upsmon[19129]: Communications with UPS [email protected] lost
Jun  3 16:15:04 SM1 upsmon[19129]: Poll UPS [[email protected]] failed - Data stale

 

 

Image-3.jpg

 

ups.conf

 

[ups]
driver = usbhid-ups
port = auto

# If not in manual mode, put any additional settings below this line
desc = "BR700ELCD"
offdelay = 120
ondelay = 0
ignorelb
override.battery.charge.low = 20
override.battery.charge.warning = 40
pollinterval = 15
pollfreq = 60

 

Link to comment
59 minutes ago, fezster said:

Still struggling with random disconnects of a CYBERPOWER BR700ELCD.

 

I tried adding the pollonly flag, as suggested on the manual page: https://networkupstools.org/docs/man/usbhid-ups.html, but this did not help.

 

I realise this is not an Unraid/NUT issue, but wondering if anyone has any other suggestions?

 

The disconnects are completely random - sometimes it goes weeks, other times only a day. And I have to unplug/replug the USB cable to get it to work again (a restart of NUT does not help).

 

Jun  3 16:14:43 SM1 usbhid-ups[19008]: nut_libusb_get_report: Input/Output Error
Jun  3 16:14:43 SM1 kernel: usb 2-2.1: USB disconnect, device number 41
Jun  3 16:14:45 SM1 kernel: usb 2-2.1: new low-speed USB device number 42 using uhci_hcd
Jun  3 16:14:46 SM1 kernel: hid-generic 0003:0764:0501.0028: hiddev96,hidraw1: USB HID v1.10 Device [CPS BR700ELCD] on usb-0000:02:00.0-2.1/
input0
Jun  3 16:14:53 SM1 kernel: usb 2-2.1: USB disconnect, device number 42
Jun  3 16:14:56 SM1 usbhid-ups[19008]: libusb1: Could not open any HID devices: insufficient permissions on everything
Jun  3 16:14:56 SM1 upsd[19125]: Data for UPS [ups] is stale - check driver
Jun  3 16:14:57 SM1 kernel: usb 2-2.1: new low-speed USB device number 43 using uhci_hcd
Jun  3 16:14:58 SM1 kernel: hid-generic 0003:0764:0501.0029: hiddev96,hidraw1: USB HID v1.10 Device [CPS BR700ELCD] on usb-0000:02:00.0-2.1/
input0
Jun  3 16:14:59 SM1 upsmon[19129]: Poll UPS [[email protected]] failed - Data stale
Jun  3 16:14:59 SM1 upsmon[19129]: Communications with UPS [email protected] lost
Jun  3 16:15:04 SM1 upsmon[19129]: Poll UPS [[email protected]] failed - Data stale

 

 

Image-3.jpg

 

ups.conf

 

[ups]
driver = usbhid-ups
port = auto

# If not in manual mode, put any additional settings below this line
desc = "BR700ELCD"
offdelay = 120
ondelay = 0
ignorelb
override.battery.charge.low = 20
override.battery.charge.warning = 40
pollinterval = 15
pollfreq = 60

 

 

Hello, sorry you're experiencing trouble. The first thing that would come to mind for me is the USB cable, then the USB port - have you tried another cable or another USB port (some UPS do behave better on USB 2.0 ports)?

Link to comment
22 minutes ago, Rysz said:

 

Hello, sorry you're experiencing trouble. The first thing that would come to mind for me is the USB cable, then the USB port - have you tried another cable or another USB port (some UPS do behave better on USB 2.0 ports)?

 

Using USB 2.0 port. Have tried a different cable. The challenge is that it's not easily reproducible, so I think it's fixed, but then it randomly happens again.

 

I'm following some advice I found in this thread: https://forum.netgate.com/topic/31120/nut-data-stale/13. It's over 10 years old, but I've set a user script to restart nut every hour (perhaps that might help).

 

#!/bin/bash
/etc/rc.d/rc.nut restart 2>&1 | logger

 

Link to comment
Just now, fezster said:

 

Using USB 2.0 port. Have tried a different cable. The challenge is that it's not easily reproducible, so I think it's fixed, but then it randomly happens again.

 

I'm following some advice I found in this thread: https://forum.netgate.com/topic/31120/nut-data-stale/13. It's over 10 years old, but I've set a user script to restart nut every hour (perhaps that might help).

 

#!/bin/bash
/etc/rc.d/rc.nut restart 2>&1 | logger

 

 

There's certainly no harm in it, although data staleness on its own is a different problem, in your case you're having actual disconnects where the USB device disappears and that in turn causes the data staleness (as seen by the driver). I've only ever seen this happen when some kind of power saving software was in effect on the server (powertop, ...) or the USB cable/USB port were broken (USB port either on the server side or UPS side). It would be interesting, if you have another machine at your disposal, to see if your UPS also disconnects there (e.g. on a Windows machine if you'd hear the connect/disconnect sounds). But probably hard to pinpoint exactly since it appears only sporadically.

Link to comment

Hi all, seems I'm having a similar issue. I only happened to randomly look at system logs to even notice it to begin with, but after noticing and scanning back through it seems ever since I first implemented the NUT app a couple days ago the same thing has been occurring regularly. Screenshot of the system log page attached below. I'm using the USB cable that was included with the UPS (CyberPower 1350VA - CST135UC2) and it is plugged in to a 2.0 port on the back of my NAS. Any advice? NUT Debug also attached.

Screen Shot 2024-06-04 at 9.19.35 AM.png

nut-debug-20240604091516.zip

Link to comment
Posted (edited)
16 minutes ago, thirtythreemangos said:

Hi all, seems I'm having a similar issue. I only happened to randomly look at system logs to even notice it to begin with, but after noticing and scanning back through it seems ever since I first implemented the NUT app a couple days ago the same thing has been occurring regularly. Screenshot of the system log page attached below. I'm using the USB cable that was included with the UPS (CyberPower 1350VA - CST135UC2) and it is plugged in to a 2.0 port on the back of my NAS. Any advice? NUT Debug also attached.

Screen Shot 2024-06-04 at 9.19.35 AM.png

nut-debug-20240604091516.zip 206.3 kB · 0 downloads

 

This is regular data staleness, as is unfortunately a problem with some UPS.

 

Does your UPS work normally and this is primarily a log spamming issue, or are there also problems with the UPS itself (e.g. being unavailable, no data in dashboards, ...)?

 

Edited by Rysz
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.

×
×
  • Create New...