[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

20 hours ago, Fribb said:

This morning I got the message "Warning communication lost with UPS".

 

I checked my NUT Settings and the UPS is listed as "On Line" with battery charge and NUT Details. But in the UPS settings it states "Lost communication". I already restarted both services and also switched USB ports without any change.

 

I do see a few warnings in the syslog like "Poll UPS failed - Data stale" or when I restart the NUT service I get "WARNING: send_to_all: write 34 bytes to socket 16 failed (ret=-1), disconnecting: Broken pipe" 

 

diagnostics are attached.

 

I have the CyberPower CP1500EPFCLCD for a year now which was running without any issues.

fribb-tower-diagnostics-20231119-0502.zip 348.98 kB · 0 downloads

 

"UPS Settings" has nothing to do with NUT, it's a separate tool (apcupsd).

In fact you should set "Start APC UPS daemon:" to "No" under "UPS Settings".

NUT and apcupsd cannot run at the same time - they'll interfere with each other.

 

Data stale warnings are usually USB timeouts and nothing to worry about.

Broken pipe warnings always occur when killing the NUT service, that's normal too.

 

So as long as everything works, "Start APC UPS daemon:" to "No" and you're all good.

Link to comment
2 hours ago, Rysz said:

"UPS Settings" has nothing to do with NUT, it's a separate tool (apcupsd).

In fact you should set "Start APC UPS daemon:" to "No" under "UPS Settings".

NUT and apcupsd cannot run at the same time - they'll interfere with each other.

 

Data stale warnings are usually USB timeouts and nothing to worry about.

Broken pipe warnings always occur when killing the NUT service, that's normal too.

 

So as long as everything works, "Start APC UPS daemon:" to "No" and you're all good.

 

Interesting, I disabled the UPS Settings and NUT seems to show everything again. Though I am wondering why it worked for a year and just now wants to crap the bed...

 

Thanks for the easy fix.

Link to comment

Hey, I have a CyberPower LX1325GU-FC UPS and am using NUT 2.8.1 backend. I am connected with USB cable, in Standalone mode, and using usbhid-ups.

 

It works great for the most part, however from time to time NUT will fail start, like for example is I reboot my whole Unraid Server it may just not start up. It's very sporadic though, sometimes it does sometimes it doesn't. When it doesn't start up usually I can just go in and disable and re-enable NUT and then it will come up. Looking at the system log I was seeing:

Can't initialize data from HID UPS

Then after turning up the log debug levels a bit I was also noticing this:

Fatal error: insufficient power configured!

 

Any ideas what's up? I have tried different USB ports, but not a new cable yet. But since it's working pretty much rock solid until I have a reboot I don't really suspect cable issue.

Link to comment

Well as a follow up to my last post, again the behavior remains strange. If I just keep trying to start NUT it just eventually works and then its solid until a next reboot. Of course this means that if my server was to shutdown due to a power event and come back up on it's own I would want NUT to be connected and working automatically. At this point all I've been able to come up with is a script I am running in CA User Scripts that I am running at array start. 

 

It simply just pgrep's "upsmon" and if not running then it will continually loop "/etc/rc.d/rc.nut start" until "upsmon" is running.  I think I should be ok with this, but if anyone sees any drawbacks with this or has something more graceful I could try then I am all ears. 

 

#!/bin/bash

# Define the process name to check
process_name="upsmon"

# Function to check if the process is running
is_process_running() {
    pgrep -x "$process_name" > /dev/null
}

#Check if process is running
if is_process_running; then
    echo "Process is already running."
    
#If not running, start it
else
    echo "Starting the process..."
   /etc/rc.d/rc.nut start
   sleep 20
    
    # Loop until the process is running
    while ! is_process_running; do
        echo "Process still not running, trying again..."
       /etc/rc.d/rc.nut start
        sleep 20 
    done
    
    echo "Process is now running."
fi

 

Link to comment
23 hours ago, nickydd9 said:

Hey, I have a CyberPower LX1325GU-FC UPS and am using NUT 2.8.1 backend. I am connected with USB cable, in Standalone mode, and using usbhid-ups.

 

It works great for the most part, however from time to time NUT will fail start, like for example is I reboot my whole Unraid Server it may just not start up. It's very sporadic though, sometimes it does sometimes it doesn't. When it doesn't start up usually I can just go in and disable and re-enable NUT and then it will come up. Looking at the system log I was seeing:

Can't initialize data from HID UPS

Then after turning up the log debug levels a bit I was also noticing this:

Fatal error: insufficient power configured!

 

Any ideas what's up? I have tried different USB ports, but not a new cable yet. But since it's working pretty much rock solid until I have a reboot I don't really suspect cable issue.

 

Do you perhaps also have the APC service running (check "UPS Settings") ?

The service in "UPS Settings" needs to be disabled, otherwise it'll interfere with NUT.

Link to comment
On 11/26/2023 at 1:57 AM, Sebastiansuisse said:

Hi, sorry kind of a beginner question. In the statistics page is it possible to somehow multiply the UPS load value as it is given in a percentage but it would be a lot easier to have it given in watts.

Screenshot 2023-11-26 at 01.57.08.png

 

You can use the statistics "Variable Override" to display the variable "ups.realpower" instead (if your UPS reports it). This can be done under "NUT Settings" and then you'll have the chart display the watts.

 

Edited by Rysz
Link to comment
14 minutes ago, nickydd9 said:

 

No, I've made sure this if off, UPS cable set to "Custom", and UPS type set to "Dumb".

 

I have noticed my exact UPS model is not listed here: https://networkupstools.org/stable-hcl.html

 

Quick search returned this (admittedly very old, but possibly still relevant) mailing list conversation: https://nut-upsuser.alioth.debian.narkive.com/bUVt7nv2/cyberpower-usbhid-ups-continuously-disconnects-reconnects

 

Might be a firmware issue in some CyberPower devices... I didn't read through all of it as I'm currently out, but looks a bit like your issue and maybe (or maybe not) provides some more clarity on it.

 

Edited by Rysz
Link to comment
10 minutes ago, Rysz said:

 

Quick search returned this (admittedly very old, but possibly still relevant) mailing list conversation: https://nut-upsuser.alioth.debian.narkive.com/bUVt7nv2/cyberpower-usbhid-ups-continuously-disconnects-reconnects

 

Might be a firmware issue in some CyberPower devices... I didn't read through all of it as I'm currently out, but looks a bit like your issue and maybe (or maybe not) provides some more clarity on it.

 

 

wow 12 years old hahaha..... but to be fair it does sound pretty similar to what is happening and lines up with the fact that once its communicating it doesn't drop out until I reboot Unraid. Well it seems the script I have created is probably the best method for me to deal with after all since it will just keep force trying the connection until I catch the UPS not busy. 

 

Thanks!

  • Like 1
Link to comment

To anybody who finds this thread.

 

As of 12/02/2023, NUT is NOT compatible with UnRaid v6.12.6, and it will be automatically removed upon upgrading.


When this compatibility issue is fixed, please reply to my comment saying it's fixed.

Just wanted to get this on here in case anyone is thinking of upgrading UnRaid, and wants to keep NUT.

  • Confused 2
Link to comment
6 minutes ago, user-115 said:

To anybody who finds this thread.

 

As of 12/02/2023, NUT is NOT compatible with UnRaid v6.12.6, and it will be automatically removed upon upgrading.


When this compatibility issue is fixed, please reply to my comment saying it's fixed.

Just wanted to get this on here in case anyone is thinking of upgrading UnRaid, and wants to keep NUT.

No issues on 6.12.6 for me

 

image.png

  • Thanks 1
Link to comment
18 minutes ago, user-115 said:

To anybody who finds this thread.

 

As of 12/02/2023, NUT is NOT compatible with UnRaid v6.12.6, and it will be automatically removed upon upgrading.


When this compatibility issue is fixed, please reply to my comment saying it's fixed.

Just wanted to get this on here in case anyone is thinking of upgrading UnRaid, and wants to keep NUT.

 

14 minutes ago, SimonF said:

No issues on 6.12.6 for me

 

I just updated from 6.12.5 to 6.12.6 and cannot reproduce the issue you described.

There's also no reason my current version of NUT wouldn't work with version 6.12.6...

 

Perhaps you were on some other deprecated version of NUT (maybe upgrading from a very old OS?)

Please make sure to install the version by me (Rysz/desertwitch), which is the only actively maintained one.

 

grafik.png

 

Edited by Rysz
  • Like 1
Link to comment
23 minutes ago, user-115 said:

To anybody who finds this thread.

 

As of 12/02/2023, NUT is NOT compatible with UnRaid v6.12.6, and it will be automatically removed upon upgrading.


When this compatibility issue is fixed, please reply to my comment saying it's fixed.

Just wanted to get this on here in case anyone is thinking of upgrading UnRaid, and wants to keep NUT.

Which OS version are you running before. I guess you have have upgraded from pre 6.12, as Rydx said you need to upgrade to the current version from CA. The original versions before Mine and theirs where not compatible due to breaking dashboard. I have passed the maintenance of my version to Rysz

  • Thanks 1
Link to comment

I'm using the newest version but also seeing the message

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

in my boot logs.

 

It still seems to work. After that it tells it is listening to 0.0.0.0 port 3493 and that its connected to ups usbhid-ups-ups and found 1 defined in the ups.conf.

Then at the last logs I see

UPS:[email protected] (primary) (power value 1)

and 

Using power down flag file /etc/nut/no_killpower

 

But how to get rid of this fopen error?

Link to comment
6 hours ago, sasbro97 said:

I'm using the newest version but also seeing the message

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

in my boot logs.

 

It still seems to work. After that it tells it is listening to 0.0.0.0 port 3493 and that its connected to ups usbhid-ups-ups and found 1 defined in the ups.conf.

Then at the last logs I see

UPS:[email protected] (primary) (power value 1)

and 

Using power down flag file /etc/nut/no_killpower

 

But how to get rid of this fopen error?

 

You can't, it's a diagnostic message built directly into NUT.

 

It only means that it's checking for duplicate instances of NUT before starting up but couldn't find any (which is a good thing)... so it's safe to ignore this message. 🙂 

 

Edited by Rysz
  • Thanks 1
Link to comment
On 11/1/2023 at 11:46 AM, Rysz said:

 

Another user on Discord had more luck pointing the UPS Driver Port directly to the respective /dev/ device assigned to the UPS (in his case e.g. /dev/ttyUSB0) instead of using auto. If you can figure out (e.g. from the logs) which /dev/ device your UPS device was assigned to, you could attempt to point the driver directly to that port instead (try it with both tripplite_usb and usbhid-ups drivers).

 

Looks like in your case that'd be: /dev/bus/usb/001/085

 

 

So i was just looking in the logs, since i was never able to get the UPS connected to NUT talking, any idea what could be causing this. I have tried numerous different usb ports. Think it is worth trying a different USB cable?

 

Dec 10 10:28:13 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A2: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:28:27 MovieServer kernel: usb 1-5: USB disconnect, device number 38
Dec 10 10:28:28 MovieServer kernel: usb 1-5: new low-speed USB device number 39 using xhci_hcd
Dec 10 10:28:28 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A3: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:28:42 MovieServer kernel: usb 1-5: USB disconnect, device number 39
Dec 10 10:28:43 MovieServer kernel: usb 1-5: new low-speed USB device number 40 using xhci_hcd
Dec 10 10:28:43 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A4: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:28:57 MovieServer kernel: usb 1-5: USB disconnect, device number 40
Dec 10 10:28:58 MovieServer kernel: usb 1-5: new low-speed USB device number 41 using xhci_hcd
Dec 10 10:28:58 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A5: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:29:12 MovieServer kernel: usb 1-5: USB disconnect, device number 41
Dec 10 10:29:13 MovieServer kernel: usb 1-5: new low-speed USB device number 42 using xhci_hcd
Dec 10 10:29:13 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A6: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:29:27 MovieServer kernel: usb 1-5: USB disconnect, device number 42
Dec 10 10:29:28 MovieServer kernel: usb 1-5: new low-speed USB device number 43 using xhci_hcd
Dec 10 10:29:28 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A7: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:29:42 MovieServer kernel: usb 1-5: USB disconnect, device number 43
Dec 10 10:29:43 MovieServer kernel: usb 1-5: new low-speed USB device number 44 using xhci_hcd
Dec 10 10:29:43 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A8: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:29:57 MovieServer kernel: usb 1-5: USB disconnect, device number 44
Dec 10 10:29:58 MovieServer kernel: usb 1-5: new low-speed USB device number 45 using xhci_hcd
Dec 10 10:29:58 MovieServer kernel: hid-generic 0003:09AE:3018.3B1A9: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:30:13 MovieServer kernel: usb 1-5: USB disconnect, device number 45
Dec 10 10:30:13 MovieServer kernel: usb 1-5: new low-speed USB device number 46 using xhci_hcd
Dec 10 10:30:13 MovieServer kernel: hid-generic 0003:09AE:3018.3B1AA: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0
Dec 10 10:30:28 MovieServer kernel: usb 1-5: USB disconnect, device number 46
Dec 10 10:30:28 MovieServer kernel: usb 1-5: new low-speed USB device number 47 using xhci_hcd
Dec 10 10:30:28 MovieServer kernel: hid-generic 0003:09AE:3018.3B1AB: hiddev96,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LITE SMART1500RM2UL ] on usb-0000:00:14.0-5/input0

 

Edited by scuppasteve
Link to comment

So for the most part I have NUT working... in the background. But I can't see anything in neither the stats page or the main nuts page giving me information about the UPS's.  The config works and is running from what I can tell from the logs.

 

image.thumb.png.7308b1e0a8099798a11ce7eb1310cace.png

 

 

image.png.4c17c7f5d83a4f31ac05a4475b4bc3de.png

 

image.thumb.png.4ef282a7d238267f2e7109be9fd155e6.png

 

image.thumb.png.2da26357f8dbd2a1fb4502d3859ff14d.png

 

I'm wondering why it doesn't show? although it reads info, batteries etc just fine when running upsc device@host

Link to comment
8 hours ago, Millerboy3 said:

So for the most part I have NUT working... in the background. But I can't see anything in neither the stats page or the main nuts page giving me information about the UPS's.  The config works and is running from what I can tell from the logs.

 

image.thumb.png.7308b1e0a8099798a11ce7eb1310cace.png

 

 

image.png.4c17c7f5d83a4f31ac05a4475b4bc3de.png

 

image.thumb.png.4ef282a7d238267f2e7109be9fd155e6.png

 

image.thumb.png.2da26357f8dbd2a1fb4502d3859ff14d.png

 

I'm wondering why it doesn't show? although it reads info, batteries etc just fine when running upsc device@host

 

This actually seems to be a previously unknown shortcoming of the plugin when operating in manual configuration mode. I'm guessing that most people usually configure via the GUI and hence this problem hasn't surfaced any sooner. I'll take a look at possible solutions and will push an update once I have it figured out. In the meantime NUT itself should function normally, just in the background, even if the GUI shows nothing.

 

Link to comment
12 hours ago, Millerboy3 said:

So for the most part I have NUT working... in the background. But I can't see anything in neither the stats page or the main nuts page giving me information about the UPS's.  The config works and is running from what I can tell from the logs.

 

image.thumb.png.7308b1e0a8099798a11ce7eb1310cace.png

 

 

image.png.4c17c7f5d83a4f31ac05a4475b4bc3de.png

 

image.thumb.png.4ef282a7d238267f2e7109be9fd155e6.png

 

image.thumb.png.2da26357f8dbd2a1fb4502d3859ff14d.png

 

I'm wondering why it doesn't show? although it reads info, batteries etc just fine when running upsc device@host

 

I have just pushed an update which fixes your issue. The "UPS Name" setting now remains visible also in Manual Configuration mode, letting you set which of your configured UPS you want the GUI dashboards to show information for. At present you can only choose one UPS to display information for in the GUI (by setting the "UPS Name" to that configured UPS' name). Showing multiple UPS in the GUI requires a larger developmental effort so I'll have to put this on the TO-DO list for now. Hope that helps... 🙂

Link to comment
25 minutes ago, Jobine said:

Since the last update, this plugin crash my server.

CPU maxes out at 100%

I delete the plugin and all works fine

 

Nothing was changed in the backend between the last updates, only optical changes in the GUI.

Can you provide logs from before you uninstalled the plugin, or perhaps a diagnostics package?

 

11 minutes ago you say "all works fine" after uninstalling NUT.

Two minutes ago you say nothing works in another topic about your problem? 😐

This seems more of a general hardware or configuration problem, rather than one caused by NUT.

If you have any logs indicating an actual problem with NUT, I'll be happy to do my best to help you... 🙂

 

Edited by Rysz
  • Like 1
Link to comment
On 12/10/2023 at 8:55 AM, Rysz said:

 

You can't, it's a diagnostic message built directly into NUT.

 

It only means that it's checking for duplicate instances of NUT before starting up but couldn't find any (which is a good thing)... so it's safe to ignore this message. 🙂 

 

Can you fix this?

That the false positive message not showing on the boot?

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.