[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

1 minute ago, Masterwishx said:

@dmacias nut-2.8.0.plg doesnt have updated ?

i found it missed 2 updates ....

###2023.06.03
- Add Small footer style thanks ich777 for the PR.
###2023.02.14
-6.12 Dashboard support
-PHP8 fixes
-Refresh option.

 

Maybe you can update 2.8.0 also ?

It is my version of the plugin 2.8.0 is a test load. I have not added the changes to that version yet. it already include 2023.02.14 but not likely to be in the change log.

 

I have not tested 2.8.0 on pre 6.12 systems and with USB attached UPS as yet. It was created to cover SNMP requirements.

  • Like 1
Link to comment
  • 2 weeks later...
On 6/3/2023 at 11:02 PM, JudasD said:

is anyone else seeing "/etc/nut/upssched.conf" get overwritten by the default file on each reboot?

 

Thanks,

JD

Yes actually I am as well.

 

I'm trying to edit "/etc/nut/upsmon.conf" and everytime I restart NUT service (as directed when editing config through plugin), I'm having "/etc/nut/upsmon.conf" returned to default.

 

Also tried editing via SSH and same thing, over written when restarting service.

 

Not sure how to have config changes stick.

 

Link to comment
3 hours ago, xinud said:

Yes actually I am as well.

 

I'm trying to edit "/etc/nut/upsmon.conf" and everytime I restart NUT service (as directed when editing config through plugin), I'm having "/etc/nut/upsmon.conf" returned to default.

 

Also tried editing via SSH and same thing, over written when restarting service.

 

Not sure how to have config changes stick.

 

BTW - I haven't upgraded to Unraid 6.12 yet - still on 6.11.5.  But I did just switch to @SimonF NUT plugin (from dmacias72 version) and same problem happens.

 

Modifying config files seem to be returned to default when starting NUT service.

Link to comment
On 6/16/2023 at 7:52 AM, xinud said:

Yes actually I am as well.

 

I'm trying to edit "/etc/nut/upsmon.conf" and everytime I restart NUT service (as directed when editing config through plugin), I'm having "/etc/nut/upsmon.conf" returned to default.

 

Also tried editing via SSH and same thing, over written when restarting service.

 

Not sure how to have config changes stick.

 

I have posted this query before, but no one replied.  This must not be a common occurrence if it is just the two of us. :(

 

I am on 6.12.0 and i did upgrade to the newest supported version.   The issue still exists.

Edited by JudasD
Link to comment

Thanks just installed this and it just works without any issues.  Mine is hooked up USB.

UPS STATUSBATTERY CHARGE %RUNTIME LEFTNOMINAL POWERUPS LOADUPS LOAD %

Online100%00:39:352250w315 Watts14%

 

Is there anyway to send a pushover or notification if the power goes out to my phone?  I dont see how to get it to communicate only to display the current stats of the UPS.

 

Link to comment
On 4/1/2023 at 8:13 AM, 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.

 

 

Running this version now with SNMP. Appears to be working as designed! Thanks!

Link to comment

@SimonF can you please check why nut-2.8.0.plg update from "nut-plugin-2023.02.14-x86_64-1" to "nut-plugin-2023.06.03-x86_64-1.txz" and become 2.7.4 in  nut-2.8.0.plg ? on 6.12.1

is anyone have update problem also for plugin ?

P.S i removed plugin then installed again , and have same problem after autoupdate

Edited by Masterwishx
Link to comment
4 hours ago, Masterwishx said:

@SimonF about "unknown 2000" device in my case , i made a debug logs for authors and they ask :

 

(Just in case: are the udev.rules (or udev.hwdb) issues ruled out? Does the OS know to not grab certain VID:PID pairs and/or to re-own them to nut:nut or similar accounts?)

 

Maybe you know about it?

 

These are my udev rules, mainly plugin related.

 

root@computenode:~# cd /etc/udev/rules.d/
root@computenode:/etc/udev/rules.d# ls
70-persistent-net.rules  99_persistent_unassigned.rules  99_persistent_usb_manager.rules
root@computenode:/etc/udev/rules.d# cat *
# PCI device 0x8086:0x15f3 (igc)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d8:bb:c1:8c:c9:b0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
ACTION=="add",    KERNEL=="sd*", ENV{DEVTYPE}=="disk"      RUN+="/usr/local/emhttp/plugins/unassigned.devices/scripts/rc.unassigned hotplug >/dev/null 2>&1 & disown"
ACTION=="add",    KERNEL=="sd*", ENV{DEVTYPE}=="partition" RUN+="/usr/local/emhttp/plugins/unassigned.devices/scripts/rc.unassigned mount >/dev/null 2>&1 & disown"
ACTION=="remove", KERNEL=="sd*"  ENV{DEVTYPE}=="disk"      RUN+="/usr/local/emhttp/plugins/unassigned.devices/scripts/rc.unassigned reload >/dev/null 2>&1 & disown"
ACTION=="remove", KERNEL=="sd*"  ENV{DEVTYPE}=="partition" RUN+="/usr/local/emhttp/plugins/unassigned.devices/scripts/rc.unassigned reload >/dev/null 2>&1 & disown"
ACTION=="change", KERNEL=="sd*", ENV{DEVTYPE}=="partition" RUN+="/usr/local/emhttp/plugins/unassigned.devices/scripts/rc.unassigned reload >/dev/null 2>&1 & disown"
ACTION=="add",SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager usb_add >/dev/null 2>&1 & disown"
ACTION=="remove",SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager usb_remove >/dev/null 2>&1 & disown"
ACTION=="add",SUBSYSTEM=="tty",RUN+="/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager tty_add >/dev/null 2>&1 & disown"root@computenode:/etc/udev/rules.d# 

  • Thanks 1
Link to comment

Thanks, another post was :

So the problem is very likely due to that original "libusb can't get the details", which may be a permissions problem or the device being busy due to someone else grabbing it with higher priority (hypervisor, OS drivers and daemons, etc.

 

The strange thing i can see all info when running ' lsusb -vv ' :

 

249145961-ee4c576f-9f8d-482a-9f25-3ec5b4

 

but device,model is unknown and no serial number :

 

249140433-d951fde4-0089-41a4-ac76-7e75d9

Link to comment
54 minutes ago, Masterwishx said:

Thanks, another post was :

So the problem is very likely due to that original "libusb can't get the details", which may be a permissions problem or the device being busy due to someone else grabbing it with higher priority (hypervisor, OS drivers and daemons, etc.

 

The strange thing i can see all info when running ' lsusb -vv ' :

 

249145961-ee4c576f-9f8d-482a-9f25-3ec5b4

 

but device,model is unknown and no serial number :

 

249140433-d951fde4-0089-41a4-ac76-7e75d9

Data comes from 

 

root@computenode:/etc/udev/rules.d# upsc [email protected]
battery.charge: 100
battery.runtime: 4500
battery.voltage: 40.20
battery.voltage.high: 40.40
battery.voltage.low: 31.20
battery.voltage.nominal: 36.0
device.type: ups
driver.name: nutdrv_qx
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.runtimecal: 900,100,1800,50
driver.parameter.synchronous: no
driver.version: 2.7.4.1
driver.version.data: Megatec 0.06
driver.version.internal: 0.39
driver.version.usb: libusb-1.0.24 (API: 0x1000107)
input.current.nominal: 6.9
input.frequency: 49.9
input.frequency.nominal: 50
input.voltage: 243.0
input.voltage.fault: 0.0
input.voltage.nominal: 230
output.voltage: 242.0
ups.beeper.status: enabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.firmware: V4.00
ups.load: 20
ups.productid: 0000
ups.status: OL
ups.temperature: 35.0
ups.type: offline / line interactive
ups.vendorid: 0001

  • Like 1
Link to comment

Is there a way to delay the startup of the plugin on server start? Currently, I'm using `custom -> apcupsd-ups` driver to pull from the apcupsd daemon, since it gives more information to me, but since they start at the same time, NUT fails to start. This means I need to go into the plugin, stop it, and manually start it again to get any data from it.

Link to comment
4 hours ago, LilDrunkenSmurf said:

Is there a way to delay the startup of the plugin on server start? Currently, I'm using `custom -> apcupsd-ups` driver to pull from the apcupsd daemon, since it gives more information to me, but since they start at the same time, NUT fails to start. This means I need to go into the plugin, stop it, and manually start it again to get any data from it.

Do you use user scripts you cou!d create one that does a delayand then /etc/rc.d/rc.nut reload

Link to comment

@SimonF Maybe you can help me with (unknown) problem ,im in tuch with developers of nut they said:

 

Thanks. So, to summarize: even though the driver is running as root, and maybe there are no competitors (who is 6609? was it somehow fuser itself or something else?), libusb in usbhid-ups won't tell the basic iProduct etc. fields used during matching and which lsusb does see, but the driver sees further info from the actual protocol query/response.

So a sort of sideways solution could be to ensure these values (if "unknown") by querying something additionally over USB HID protocol, if the device serves those data points.

But the primary direct solution would be to find out why they are "unknown" in the first place and avoiding that. And documenting in how-to's for posterity.

 

> fuser /dev/bus/usb/003/002
Cannot stat file /proc/6609/fd/46: Stale file handle
/dev/bus/usb/003/002:  7697

 

i found 6609 its smb deamon , maybe its used becose of netserver ups mode in my case , im using for Windows client (my Main PC)

The strange thing i can see all info when running ' lsusb -vv ' :

 

So maybe you can suggest something ?

 

 

 

Link to comment
1 hour ago, Masterwishx said:

@SimonF Maybe you can help me with (unknown) problem ,im in tuch with developers of nut they said:

 

Thanks. So, to summarize: even though the driver is running as root, and maybe there are no competitors (who is 6609? was it somehow fuser itself or something else?), libusb in usbhid-ups won't tell the basic iProduct etc. fields used during matching and which lsusb does see, but the driver sees further info from the actual protocol query/response.

So a sort of sideways solution could be to ensure these values (if "unknown") by querying something additionally over USB HID protocol, if the device serves those data points.

But the primary direct solution would be to find out why they are "unknown" in the first place and avoiding that. And documenting in how-to's for posterity.

 

> fuser /dev/bus/usb/003/002
Cannot stat file /proc/6609/fd/46: Stale file handle
/dev/bus/usb/003/002:  7697

 

i found 6609 its smb deamon , maybe its used becose of netserver ups mode in my case , im using for Windows client (my Main PC)

The strange thing i can see all info when running ' lsusb -vv ' :

 

So maybe you can suggest something ?

 

 

 

This is my server. Which is netserver.

 

root@unraid:~# ps -ef | grep nut
root     29932 23616  0 16:16 pts/40   00:00:00 grep nut
root     30896     1  0 Jun03 ?        00:11:14 /usr/libexec/nut/nutdrv_qx -a ups -u root
root@unraid:~# fuser /dev/bus/usb/002/020
/dev/bus/usb/002/020: 30896

 

not sure why you have a smb. So are the NUT devs saying that it gets the info from usb device. Will look at their code. I may be able to get info myself from udev if it is unknown.

 

What does udevadm info  /dev/bus/usb/003/002 show for you.

 

root@unraid:~# udevadm info  /dev/bus/usb/002/020
P: /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4
N: bus/usb/002/020
E: BUSNUM=002
E: DEVNAME=/dev/bus/usb/002/020
E: DEVNUM=020
E: DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_FOR_SEAT=usb-pci-0000_00_1d_0-usb-0_1_4
E: ID_MODEL=ATCL_FOR_UPS
E: ID_MODEL_ENC=ATCL\x20FOR\x20UPS
E: ID_MODEL_ID=0000
E: ID_PATH=pci-0000:00:1d.0-usb-0:1.4
E: ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_4
E: ID_REVISION=0000
E: ID_SERIAL=ATCL_FOR_UPS_ATCL_FOR_UPS_ATCL_FOR_UPS
E: ID_SERIAL_SHORT=ATCL_FOR_UPS
E: ID_USB_INTERFACES=:030000:
E: ID_VENDOR=ATCL_FOR_UPS
E: ID_VENDOR_ENC=ATCL\x20FOR\x20UPS
E: ID_VENDOR_ID=0001
E: MAJOR=189
E: MINOR=147
E: PRODUCT=1/0/0
E: SUBSYSTEM=usb
E: TAGS=:seat:
E: TYPE=0/0/0
E: USEC_INITIALIZED=3385593080314

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.