[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

20 minutes ago, Masterwishx said:

i think

shutdown.return - standby 

shutdown.stayoff - shut down

 

Yeah, I think so too, but with "stayoff" it probably won't be able to turn on again on its own.

Because I found this about standby mode in the 9SX manual which is a similar also online model :

grafik.png.e68b1111112b48cd312f5b4585e430cd.png

And this reads to me like it's only able to wake up again when in standby mode (as opposed to when it's completely off). I'm guessing perhaps it needs to stay in standby for the software in the UPS to recognise that the AC is back.

 

The driver flag has nothing to do with it, that's just a safeguard so you can't execute the kill command from upscmd and bring down your running system by mistake. But during system shutdown it's executed directly from the driver (and not upscmd) so it's not needed in your case.

 

Edited by Rysz
  • Thanks 1
Link to comment
3 hours ago, Masterwishx said:

or it will not power on then if it possible at all?

Sounds like OFF is what you'd use if you didn't want it to power back on, e.g. for storage.

 

Easy to check, do what they say to power it off, then plug it back in... if it stays off until you manually turn it back on that's what would happen on a power loss if it was off.

  • Like 1
  • Thanks 1
Link to comment
4 minutes ago, Kilrah said:

Sounds like OFF is what you'd use if you didn't want it to power back on, e.g. for storage.

 

Easy to check, do what they say to power it off, then plug it back in... if it stays off until you manually turn it back on that's what would happen on a power loss if it was off.

 

That's actually a very good idea for a simulation test. So basically shutdown everything, turn off UPS completely by button (not standby), remove mains power cable, wait a minute or two, reconnect mains power cable and see what happens (if it turns on).

 

Edited by Rysz
  • Like 1
Link to comment
15 minutes ago, Kilrah said:

Easy to check, do what they say to power it off, then plug it back in... if it stays off until you manually turn it back on that's what would happen on a power loss if it was off.

 

11 minutes ago, Rysz said:

That's actually a very good idea for a simulation test. So basically shutdown everything, turn off UPS completely by button (not standby), remove mains power cable, wait a minute or two, reconnect mains power cable and see what happens (if it turns on).

 

Thanks i will try it , i  was using it by button before , just not sure how it was working then

only today i enabled (Disable UPS Power after Shutdown=yes) ,and its already working fine ...

just wanted to check this moment of stanby, so i think its really needs to be in standby for it can power on again when power return to normal...

 

  • Like 1
Link to comment

I have had NUT working fine for some time. But to be fair, have not looked for a month or two too see if it was working and had no warnings or alerts. I had to move my server today as we are painting and noticed when bringing it back up, it has stopped working.

My UPC is a APC BX700U Series. Motherboard is Supermicro X10SL7-F

  1. The APC UPS daemon is NOT activated
  2. I have tried two different USB cables and 3 different USB ports. I have ordered a new cable and will try that.
  3. I have tried both the current version and the 2.7.4 version (with restart)

I am attaching my diagnostics. Here is what I am getting in the SYSLOG:
 

Mar  9 16:42:28 Zack-unRAID root: Writing NUT configuration...
Mar  9 16:42:30 Zack-unRAID root: Updating permissions for NUT...
Mar  9 16:42:30 Zack-unRAID root: Checking if the NUT Runtime Statistics Module should be enabled...
Mar  9 16:42:30 Zack-unRAID root: Enabling the NUT Runtime Statistics Module...
Mar  9 16:42:31 Zack-unRAID root: Network UPS Tools - Generic HID driver 0.55 (2.7.4.1)
Mar  9 16:42:31 Zack-unRAID root: USB communication driver 0.43
Mar  9 16:42:31 Zack-unRAID root: No matching HID UPS found
Mar  9 16:42:31 Zack-unRAID root: Driver failed to start (exit status=1)
Mar  9 16:42:31 Zack-unRAID root: Network UPS Tools - UPS driver controller 2.7.4.1
Mar  9 16:45:56 Zack-unRAID pulseway: First reporting data collection finished
Mar  9 16:51:00 Zack-unRAID root: Fix Common Problems Version 2024.02.29
Mar  9 16:52:02 Zack-unRAID ool www[14520]: /usr/local/emhttp/plugins/nut-dw/scripts/start
Mar  9 16:52:03 Zack-unRAID root: Writing NUT configuration...
Mar  9 16:52:05 Zack-unRAID root: Updating permissions for NUT...
Mar  9 16:52:05 Zack-unRAID root: Checking if the NUT Runtime Statistics Module should be enabled...
Mar  9 16:52:05 Zack-unRAID root: Enabling the NUT Runtime Statistics Module...
Mar  9 16:52:06 Zack-unRAID root: Network UPS Tools - Generic HID driver 0.55 (2.7.4.1)
Mar  9 16:52:06 Zack-unRAID root: USB communication driver 0.43
Mar  9 16:52:06 Zack-unRAID root: No matching HID UPS found
Mar  9 16:52:06 Zack-unRAID root: Driver failed to start (exit status=1)
Mar  9 16:52:06 Zack-unRAID root: Network UPS Tools - UPS driver controller 2.7.4.1

 

Here is what I am getting in NUT USB Diagnostics...

 

 ###
### USB DEVICES
###

Bus 002 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 0557:2419 ATEN International Co., Ltd Virtual mouse/keyboard device
Bus 003 Device 003: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 003 Device 002: ID 0781:5571 SanDisk Corp. Cruzer Fit
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

###
### USB DEVICES (TREE VIEW)
###

/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
ID 0781:5571 SanDisk Corp. Cruzer Fit
|__ Port 7: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
ID 0557:7000 ATEN International Co., Ltd Hub
|__ Port 1: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
ID 0557:2419 ATEN International Co., Ltd Virtual mouse/keyboard device
|__ Port 1: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
ID 0557:2419 ATEN International Co., Ltd Virtual mouse/keyboard device
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 8087:8008 Intel Corp. Integrated Rate Matching Hub

###
### USB POWER MANAGEMENT SETTINGS
### ON: ALWAYS ON / AUTO: SYSTEM MANAGED
###

==> /sys/bus/usb/devices/1-1/power/control <==
auto

==> /sys/bus/usb/devices/2-1/power/control <==
auto

==> /sys/bus/usb/devices/3-1/power/control <==
on

==> /sys/bus/usb/devices/3-7.1/power/control <==
on

==> /sys/bus/usb/devices/3-7/power/control <==
auto

==> /sys/bus/usb/devices/usb1/power/control <==
auto

==> /sys/bus/usb/devices/usb2/power/control <==
auto

==> /sys/bus/usb/devices/usb3/power/control <==
auto

==> /sys/bus/usb/devices/usb4/power/control <==
auto

###
### USB RELATED KERNEL MESSAGES
###

[ 0.381770] usbcore: registered new interface driver usbfs
[ 0.381877] usbcore: registered new interface driver hub
[ 0.381986] usbcore: registered new device driver usb
[ 0.425339] pci 0000:00:1a.0: quirk_usb_early_handoff+0x0/0x63b took 16379 usecs
[ 0.442337] pci 0000:00:1d.0: quirk_usb_early_handoff+0x0/0x63b took 16475 usecs
[ 1.988551] usbcore: registered new interface driver usb-storage
[ 1.988989] usbcore: registered new interface driver synaptics_usb
[ 1.991126] usbcore: registered new interface driver usbhid
[ 1.991234] usbhid: USB HID core driver
[ 2.208343] usb 1-1: new high-speed USB device number 2 using ehci-pci
[ 2.224346] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[ 2.224470] usb 2-1: new high-speed USB device number 2 using ehci-pci
[ 2.352117] usb-storage 3-1:1.0: USB Mass Storage device detected
[ 2.352581] scsi host0: usb-storage 3-1:1.0
[ 2.466334] usb 3-7: new high-speed USB device number 3 using xhci_hcd
[ 2.890359] usb 3-7.1: new low-speed USB device number 4 using xhci_hcd
[ 3.002104] input: HID 0557:2419 as /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7.1/3-7.1:1.0/0003:0557:2419.0001/input/input1
[ 3.054596] hid-generic 0003:0557:2419.0001: input,hidraw0: USB HID v1.00 Keyboard [HID 0557:2419] on usb-0000:00:14.0-7.1/input0
[ 3.056387] input: HID 0557:2419 as /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7.1/3-7.1:1.1/0003:0557:2419.0002/input/input2
[ 3.057039] hid-generic 0003:0557:2419.0002: input,hidraw1: USB HID v1.00 Mouse [HID 0557:2419] on usb-0000:00:14.0-7.1/input1


My concern is it the the USB ports on my server or the USB port into the UPC.

 

Ideas on what else I can do to try to debug and/or fix this?

zack-unraid-diagnostics-20240309-1631.zip

Link to comment
2 minutes ago, TexasDave said:

I have had NUT working fine for some time. But to be fair, have not looked for a month or two too see if it was working and had no warnings or alerts. I had to move my server today as we are painting and noticed when bringing it back up, it has stopped working.

My UPC is a APC BX700U Series. Motherboard is Supermicro X10SL7-F

  1. The APC UPS daemon is NOT activated
  2. I have tried two different USB cables and 3 different USB ports. I have ordered a new cable and will try that.
  3. I have tried both the current version and the 2.7.4 version (with restart)

I am attaching my diagnostics. Here is what I am getting in the SYSLOG:
 

Mar  9 16:42:28 Zack-unRAID root: Writing NUT configuration...
Mar  9 16:42:30 Zack-unRAID root: Updating permissions for NUT...
Mar  9 16:42:30 Zack-unRAID root: Checking if the NUT Runtime Statistics Module should be enabled...
Mar  9 16:42:30 Zack-unRAID root: Enabling the NUT Runtime Statistics Module...
Mar  9 16:42:31 Zack-unRAID root: Network UPS Tools - Generic HID driver 0.55 (2.7.4.1)
Mar  9 16:42:31 Zack-unRAID root: USB communication driver 0.43
Mar  9 16:42:31 Zack-unRAID root: No matching HID UPS found
Mar  9 16:42:31 Zack-unRAID root: Driver failed to start (exit status=1)
Mar  9 16:42:31 Zack-unRAID root: Network UPS Tools - UPS driver controller 2.7.4.1
Mar  9 16:45:56 Zack-unRAID pulseway: First reporting data collection finished
Mar  9 16:51:00 Zack-unRAID root: Fix Common Problems Version 2024.02.29
Mar  9 16:52:02 Zack-unRAID ool www[14520]: /usr/local/emhttp/plugins/nut-dw/scripts/start
Mar  9 16:52:03 Zack-unRAID root: Writing NUT configuration...
Mar  9 16:52:05 Zack-unRAID root: Updating permissions for NUT...
Mar  9 16:52:05 Zack-unRAID root: Checking if the NUT Runtime Statistics Module should be enabled...
Mar  9 16:52:05 Zack-unRAID root: Enabling the NUT Runtime Statistics Module...
Mar  9 16:52:06 Zack-unRAID root: Network UPS Tools - Generic HID driver 0.55 (2.7.4.1)
Mar  9 16:52:06 Zack-unRAID root: USB communication driver 0.43
Mar  9 16:52:06 Zack-unRAID root: No matching HID UPS found
Mar  9 16:52:06 Zack-unRAID root: Driver failed to start (exit status=1)
Mar  9 16:52:06 Zack-unRAID root: Network UPS Tools - UPS driver controller 2.7.4.1

 

Here is what I am getting in NUT USB Diagnostics...

 

 ###
### USB DEVICES
###

Bus 002 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 0557:2419 ATEN International Co., Ltd Virtual mouse/keyboard device
Bus 003 Device 003: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 003 Device 002: ID 0781:5571 SanDisk Corp. Cruzer Fit
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

###
### USB DEVICES (TREE VIEW)
###

/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
ID 0781:5571 SanDisk Corp. Cruzer Fit
|__ Port 7: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
ID 0557:7000 ATEN International Co., Ltd Hub
|__ Port 1: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
ID 0557:2419 ATEN International Co., Ltd Virtual mouse/keyboard device
|__ Port 1: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
ID 0557:2419 ATEN International Co., Ltd Virtual mouse/keyboard device
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 8087:8008 Intel Corp. Integrated Rate Matching Hub

###
### USB POWER MANAGEMENT SETTINGS
### ON: ALWAYS ON / AUTO: SYSTEM MANAGED
###

==> /sys/bus/usb/devices/1-1/power/control <==
auto

==> /sys/bus/usb/devices/2-1/power/control <==
auto

==> /sys/bus/usb/devices/3-1/power/control <==
on

==> /sys/bus/usb/devices/3-7.1/power/control <==
on

==> /sys/bus/usb/devices/3-7/power/control <==
auto

==> /sys/bus/usb/devices/usb1/power/control <==
auto

==> /sys/bus/usb/devices/usb2/power/control <==
auto

==> /sys/bus/usb/devices/usb3/power/control <==
auto

==> /sys/bus/usb/devices/usb4/power/control <==
auto

###
### USB RELATED KERNEL MESSAGES
###

[ 0.381770] usbcore: registered new interface driver usbfs
[ 0.381877] usbcore: registered new interface driver hub
[ 0.381986] usbcore: registered new device driver usb
[ 0.425339] pci 0000:00:1a.0: quirk_usb_early_handoff+0x0/0x63b took 16379 usecs
[ 0.442337] pci 0000:00:1d.0: quirk_usb_early_handoff+0x0/0x63b took 16475 usecs
[ 1.988551] usbcore: registered new interface driver usb-storage
[ 1.988989] usbcore: registered new interface driver synaptics_usb
[ 1.991126] usbcore: registered new interface driver usbhid
[ 1.991234] usbhid: USB HID core driver
[ 2.208343] usb 1-1: new high-speed USB device number 2 using ehci-pci
[ 2.224346] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[ 2.224470] usb 2-1: new high-speed USB device number 2 using ehci-pci
[ 2.352117] usb-storage 3-1:1.0: USB Mass Storage device detected
[ 2.352581] scsi host0: usb-storage 3-1:1.0
[ 2.466334] usb 3-7: new high-speed USB device number 3 using xhci_hcd
[ 2.890359] usb 3-7.1: new low-speed USB device number 4 using xhci_hcd
[ 3.002104] input: HID 0557:2419 as /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7.1/3-7.1:1.0/0003:0557:2419.0001/input/input1
[ 3.054596] hid-generic 0003:0557:2419.0001: input,hidraw0: USB HID v1.00 Keyboard [HID 0557:2419] on usb-0000:00:14.0-7.1/input0
[ 3.056387] input: HID 0557:2419 as /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7.1/3-7.1:1.1/0003:0557:2419.0002/input/input2
[ 3.057039] hid-generic 0003:0557:2419.0002: input,hidraw1: USB HID v1.00 Mouse [HID 0557:2419] on usb-0000:00:14.0-7.1/input1


My concern is it the the USB ports on my server or the USB port into the UPC.

 

Ideas on what else I can do to try to debug and/or fix this?

zack-unraid-diagnostics-20240309-1631.zip 187.94 kB · 0 downloads

 

Thanks for the detailed information, it seems your system doesn't see the USB device at all. Can you also post the NUT Debug Package (can be found inside NUT Settings) just for me to have a complete picture there? Do you perhaps have a Windows device (e.g. laptop or whatever) around you could try connecting the UPS to and see if it shows up there at all (Device Manager)? Looking at this my first guess would be the USB cable has gone bad - broken port on the UPS is less likely (but not impossible).

Link to comment

The cables seem fine. I can plug them into a printer and a Windows laptop sees them...

 

I strongly suspect the usb port on the actual UPC - it seems very "loose" - not sure how that happened.

 

May be time for a new UPS. 😞

Edited by TexasDave
Link to comment
9 minutes ago, TexasDave said:

The cables seem fine. I can plug them into a printer and a Windows laptop sees them...

 

I strongly suspect the usb port on the actual UPC - it seems very "loose" - not sure how that happened.

 

May be time for a new UPC. 😞

 

Thanks for the additional information, unfortunately nothing is being picked up by the NUT device scanner either. So it seems to be the USB port on the UPS indeed, especially so if the cable works with other devices. Sorry I couldn't be of more help there.

  • Like 1
Link to comment
2 minutes ago, Rysz said:

 

Thanks for the additional information, unfortunately nothing is being picked up by the NUT device scanner either. So it seems to be the USB port on the UPS indeed, especially so if the cable works with other devices. Sorry I couldn't be of more help there.

 

You have been a big help - no worries at all. And the plugin is much appreciated.

Question: I assume I can still use my UPS short term? It will just supply power if I lose power but does not have any smarts so unRAID will not shutdown. So all it does now is keep it up and running and I have to hope the power comes back on before it runs out of charge?

Link to comment
7 hours ago, TexasDave said:

 

You have been a big help - no worries at all. And the plugin is much appreciated.

Question: I assume I can still use my UPS short term? It will just supply power if I lose power but does not have any smarts so unRAID will not shutdown. So all it does now is keep it up and running and I have to hope the power comes back on before it runs out of charge?

 

Yes, exactly, now it's just a "dumb" UPS.

  • Like 1
Link to comment
On 3/9/2024 at 4:41 PM, TexasDave said:

So all it does now is keep it up and running and I have to hope the power comes back on before it runs out of charge?

Do you have any other UPS's on machines around the house? If you do, you can set the server to slave, run apcupsd or nut on the other machine and set your Unraid machine to shut down after a couple minutes of power loss.

Link to comment

Migrated from the legacy NUT plugin, and all is working fine -- but I can't see where the "automatic shutdown" options have been moved to. If I'm not mistaken, the legacy plugin had support for this. Am I just blind?

 

Is there any way to enable auto-shutdown of the local Unraid host as a UPS battery percentage level?

 

Does anyone know how to trigger Unraid's graceful shutdown, versus a generic power-off that may not wait for Docker/VMs to shutdown and unmount the array first?

Link to comment
20 minutes ago, shapeshiftr said:

versus a generic power-off that may not wait for Docker/VMs to shutdown and unmount the array first?

There isn't one. Shutdown/reboot always stops everything cleanly. 

 

Options are on the NUT settings page where you'd expect them?

Edited by Kilrah
Link to comment
17 minutes ago, Kilrah said:

There isn't one. Shutdown/reboot always stops everything cleanly. 

 

Options are on the NUT settings page where you'd expect them?

 

Unless I'm seeing something different to you, the only place I can see power settings in the NUT config section of Unraid -> Settings is in CLI for "/etc/nut/upsmon.conf"

 

MONITOR [email protected] 1 monuser monpass master
SHUTDOWNCMD "/sbin/poweroff"
POWERDOWNFLAG /etc/nut/no_killpower
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYCMD "/usr/sbin/nut-notify"

 

Didn't there used to be a GUI option to configure this, or am I just misremembering?

firefox_gvUcKYZqyT.png

Link to comment
6 hours ago, shapeshiftr said:

 

Unless I'm seeing something different to you, the only place I can see power settings in the NUT config section of Unraid -> Settings is in CLI for "/etc/nut/upsmon.conf"

 

MONITOR [email protected] 1 monuser monpass master
SHUTDOWNCMD "/sbin/poweroff"
POWERDOWNFLAG /etc/nut/no_killpower
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYCMD "/usr/sbin/nut-notify"

 

Didn't there used to be a GUI option to configure this, or am I just misremembering?

firefox_gvUcKYZqyT.png

 

It's because you're using manual configuration mode where everything is supposed to be configured through the configuration files. You'll have to set manual configuration mode to "No" or "for UPS Driver" (if your UPS needs custom settings to be recognized) in order to see the GUI options. I'm guessing you enabled manual configuration mode because your UPS.CONF file has special directives needed for your UPS, so I'd switch to "for UPS Driver" so that those are kept unchanged but you can still use the GUI.

 

Edited by Rysz
Link to comment

Hi,

First of all, thanks for maintaining this plugin!

Unfortunately i had 2 power cuts in the last week that lasted more than the normal few seconds, and some weird stuff happened, and i cant figure out exactly whats wrong.
In attachment, debug zip, and print screens.

 

Sequence of events:
The settings are set to power off when battery.runtime < 300. UPS battery is quite new, and seems to be reporting accurate runtime.

21:30 The power failed
21:26 NUT script decided it was time to shutdown the server. But runtime at that time was >900s left (check last image)

(Somehow the server started back up, unrelated to NUT, i have to check my BIOS settings... i guess wake by USB or something is causing this)
At 21:29, it was back up, and battery runtime was 822.
At 21:39 NUT script decided it was time to shutdown, this time with the correct runtime left.

Not sure how to debug this at all.
I took a look at the scripts and all looks great, the only way i see to this fail is if the upsc command fails, making grep/awk fail causing the -gt comparison to fail somehow (nut-notify@L72), I'm probably way off on this, my bash script skills are 0 to none 🤣

unraid1.png

unraid2.png

unraid3.png

unraid4.png

nut-debug-20240315085147.zip

Edited by danielb7390
  • Thanks 1
Link to comment
35 minutes ago, danielb7390 said:

Hi,

First of all, thanks for maintaining this plugin!

Unfortunately i had 2 power cuts in the last week that lasted more than the normal few seconds, and some weird stuff happened, and i cant figure out exactly whats wrong.
In attachment, debug zip, and print screens.

 

Sequence of events:
The settings are set to power off when battery.runtime < 300. UPS battery is quite new, and seems to be reporting accurate runtime.

21:30 The power failed
21:26 NUT script decided it was time to shutdown the server. But runtime at that time was >900s left (check last image)

(Somehow the server started back up, unrelated to NUT, i have to check my BIOS settings... i guess wake by USB or something is causing this)
At 21:29, it was back up, and battery runtime was 822.
At 21:39 NUT script decided it was time to shutdown, this time with the correct runtime left.

Not sure how to debug this at all.
I took a look at the scripts and all looks great, the only way i see to this fail is if the upsc command fails, making grep/awk fail causing the -gt comparison to fail somehow (nut-notify@L72), I'm probably way off on this, my bash script skills are 0 to none 🤣

unraid1.png

unraid2.png

unraid3.png

unraid4.png

nut-debug-20240315085147.zip 14.86 kB · 1 download

 

Thanks for the detailed information, I think you could be right about your observations. Another possibility is that NUT has lost communication with the UPS for a short time and by in-built backend behaviour NUT always considers a non-communicating UPS that was last seen on battery as critical and immediately sets FSD and shuts down. But since the other computer managed to remain in contact with the UPS a failing command chain is more likely. That script is a 7 years old and could use some general overhauling. I'll introduce some safeguards against any failing upsc-grep-awk chains, which I'm generally not that happy with in their current state, with the next update but it might take a while.

  • Like 1
Link to comment
On 3/15/2024 at 10:26 AM, danielb7390 said:

Hi,

First of all, thanks for maintaining this plugin!

Unfortunately i had 2 power cuts in the last week that lasted more than the normal few seconds, and some weird stuff happened, and i cant figure out exactly whats wrong.
In attachment, debug zip, and print screens.

 

Sequence of events:
The settings are set to power off when battery.runtime < 300. UPS battery is quite new, and seems to be reporting accurate runtime.

21:30 The power failed
21:26 NUT script decided it was time to shutdown the server. But runtime at that time was >900s left (check last image)

(Somehow the server started back up, unrelated to NUT, i have to check my BIOS settings... i guess wake by USB or something is causing this)
At 21:29, it was back up, and battery runtime was 822.
At 21:39 NUT script decided it was time to shutdown, this time with the correct runtime left.

Not sure how to debug this at all.
I took a look at the scripts and all looks great, the only way i see to this fail is if the upsc command fails, making grep/awk fail causing the -gt comparison to fail somehow (nut-notify@L72), I'm probably way off on this, my bash script skills are 0 to none 🤣

unraid1.png

unraid2.png

unraid3.png

unraid4.png

nut-debug-20240315085147.zip 14.86 kB · 1 download

 

This is fixed now - thanks a lot for your investigation, I've taken the liberty of crediting you in the changelog. If you're interested how I solved this: https://github.com/desertwitch/NUT-unRAID/blob/2b7b5113df28836b68e1089d81cdf6095eec861e/source/nut-dw/usr/sbin/nut-notify#L71-L102

  • Like 1
Link to comment

Hi, today my new UPS (APC BX1200MI-GR) arrived, set it up and charging, but in the notification I'm getting this:
image.png.f68a30ff3c7e85675b9dc3a9d8623fa4.png

Is not true, it's going to 100%

Other screens:
image.thumb.png.8e2b8c07689ff2be2c9c30ca02c22ce7.png

image.thumb.png.01a223859419a134bc53ce0513894407.png

While making the screens I saw live the percentage going to 0% then back to 99%, triggering the notification
I'm connected to NUT with Home Assistant for automation, but I'm on standalone, it works but is it correct?
Yes I have powertop but I checked and it isn't touching the UPS USB, and it worked the same with the old UPS, same UPS but 950VA

nut-debug-20240316165522.zip

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