[Plugin] NUT v2 - Network UPS Tools


dmacias

412 posts in this topic Last Reply

Recommended Posts

I built latest nut sources for unRAID with usb support only.

 

Here is steps to build it on ubuntu/debian:

 

apt update && apt install ca-certificates freeipmi git libusb-dev autoconf automake make libtool python --no-install-recommends -y
git clone --depth 1  https://github.com/networkupstools/nut.git && cd nut
./autogen.sh
./configure --enable-strip --with-usb --datarootdir=/usr/share/nut --bindir=/usr/bin --sbindir=/usr/sbin --prefix=/ --sysconfdir=/etc/nut --libexecdir=/usr/libexec/nut --runstatedir=/var/run/nut --libdir=/usr/lib64 --with-drvpath=/usr/libexec/nut && make -j `nproc` &&  make install


 

 

 

Edited by IGHOR
Link to post
  • Replies 411
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

NUT plugin v2 for unRAID 6.1+   NUT - Network UPS Tools - http://www.networkupstools.org/   Based on the original NUT plugin by macester Original thread https://forums.lime-technology.com/topic/

Try running from the command line ps aux | grep ups   If something is still running run e.g. killall upsmon   There's some differences between the nut packages. I think I need to add some more checks

Easiest is to start and stop nut in cli, so u see what error it reports.   /etc/rc.d/rc.nut start and rc.nut stop   So change settings, start nut in cli and see what it says.

Posted Images

3 minutes ago, IGHOR said:

I built latest nut sources for unRAID with usb support only.

In terminal tests it works fine, I'm getting outputs of voltages, but in unRAID UI it won't display info.

Anyone how to fix it?

 

Here is steps to build it on ubuntu/debian:

 



apt update && apt install ca-certificates freeipmi git libusb-dev autoconf automake make libtool python --no-install-recommends -y
git clone --depth 1  https://github.com/networkupstools/nut.git && cd nut
./autogen.sh
./configure --enable-strip --with-usb --datarootdir=/usr/share/nut --bindir=/usr/bin --sbindir=/usr/sbin --prefix=/ --sysconfdir=/etc/nut --libexecdir=/usr/libexec/nut --libdir=/usr/lib64 --with-drvpath=/usr/libexec/nut && make -j `nproc` &&  make install


 

 

nut-2.7.4.1.20210620-x86_64-1.txz 805.54 kB · 0 downloads

It was recommended to me on unraid subreddit to spin up an Ubuntu VM. Pass through the usb connection and make it the host. Then make unraid NUT the slave and it would read the host. 
 

wish the plugin maker would reply or update this flipping build. 
 

No idea on that either. 

Edited by Jammy B
Link to post
20 minutes ago, Jammy B said:

wish the plugin maker would reply or update this flipping build. 

Actually latest compilation of nut is working. It is possible parsing problem in the plugin code, not nut itself
In command line it works

root@unRAID:/# upsc ups@127.0.0.1
battery.voltage: 27.30
device.type: ups
driver.flag.noscanlangid: enabled
driver.flag.novendor: enabled
driver.name: nutdrv_qx
driver.parameter.langid_fix: 0x0409
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.productid: 0000
driver.parameter.protocol: hunnox
driver.parameter.synchronous: no
driver.parameter.vendorid: 0001
driver.version: 2.7.4.1
driver.version.data: Hunnox 0.01
driver.version.internal: 0.30
input.frequency: 49.6
input.voltage: 217.0
input.voltage.fault: 0.0
output.voltage: 220.0
ups.beeper.status: disabled
ups.delay.shutdown: 60
ups.delay.start: 0
ups.load: 13
ups.productid: 0000
ups.status: OL
ups.temperature: 29.0
ups.type: offline / line interactive
ups.vendorid: 0001

 

Edited by IGHOR
Link to post

I fixed it, maybe it is just enough to put the file to this folder /boot/config/plugins/nut

Or replace existing one. Anyway if extracted to root, it starts working instantly.

 

So everything is working fine with nut compiled from latest sources.

There should be nothing that stops plugin dev to release an update.

Here is a right commands to compile nut to run on unRAID:

apt update && apt install ca-certificates freeipmi git libusb-dev autoconf automake make libtool python --no-install-recommends -y
git clone --depth 1  https://github.com/networkupstools/nut.git && cd nut
./autogen.sh

./configure --enable-strip --runstatedir=/var/run/nut --with-pidpath=/var/run/nut --with-usb --datarootdir=/usr/share/nut --bindir=/usr/bin --sbindir=/usr/sbin --prefix=/ --sysconfdir=/etc/nut --libexecdir=/usr/libexec/nut --libdir=/usr/lib64 --with-drvpath=/usr/libexec/nut && make -j `nproc` &&  make install

 

nut-2.7.4.1.20210620-x86_64-1.txz

Edited by IGHOR
Link to post

@IGHOR 

 

Can I be really cheeky and ask that you make a step-by-step guide to do all this please?

 

would love to update NUT and get my Powercool working. 
 

edit. To add, it’ll make all of us who to update it and add more UPSs to it a lot more willing!

 

 

. 👍

Edited by Jammy B
Link to post
1 hour ago, Jammy B said:

@IGHOR 

 

Can I be really cheeky and ask that you make a step-by-step guide to do all this please?

 

 

I think you need just copy the file 'nut-2.7.4.1.20210620-x86_64-1.txz' attached in my message to folder /boot/config/plugins/nut
And reboot server, it may use latest version of nut instead of old one.

If it not works this way, replace existing nut-2.7.4... file in folder /boot/config/plugins/nut by my file and reboot

Link to post

I tested and it survived reboot, also here is updated file with some fixes.

How to install:

1) copy the attached file and replace it in the folder /boot/config/plugins/nut

2) reboot

It will remain to be the same plugin, but with newer nut v2.7.4.1 for usb devices only.

Once plugin dev update it officially, it will be upgraded natively

nut-2.7.4.20200318-x86_64-1.txz

Link to post

@IGHOR

 

YOU ARE THE MAN!!!!!!

 

powered down my unraid system.

 

removed usb key

 

plugged into laptop and copied your file over.

 

back into machine, boot up and autodetect set custom driver.

 

it flippin' works! whilst i don't get

BATTERY CHARGE %

RUNTIME LEFT

NOMINAL POWER

UPS LOAD

 

i do get UPS LOAD % 

 

when i kill power to the UPS, unraid knows about it! i've set it to power down the system after 4 minutes of battery time. when i turn power back on, the unraid recognises it is!

 

all telegram notifications work as well.

 

thank you so much for doing this!

Link to post
1 hour ago, Jammy B said:

i don't get

BATTERY CHARGE %

RUNTIME LEFT

NOMINAL POWER

UPS LOAD

 

I think nut can't get those values from some UPS
And driver calculate it by voltage, and if you calibrate nut and define high/low voltages it will show % and runtime left

Link to post
3 minutes ago, IGHOR said:

 

I think nut can't get those values from some UPS
And driver calculate it by voltage, and if you calibrate nut and define high/low voltages it will show % and runtime left


How would I go about calibrating NUT?

Link to post
57 minutes ago, Jammy B said:


How would I go about calibrating NUT?

You need to find out those values for your ups
default.battery.voltage.high =
default.battery.voltage.low =
default.battery.voltage.nominal =

Link to post

You’re right. The manual only shows 12v. But typically if you post something inaccurate, you get helpful responses. 👍

 

see attached screenshots of NUT which don’t show a lot either. 
 

so based on your link. 
 

high = 13v

nominal = 12v

low = 10.7v

 

although NUT says battery voltage 27.10? So the batteries in series?

 

so high = 27.10v

nominal = 24v

low = 21.4v


 

3A7EEA5F-BDEC-487A-82D0-19699AA73EFB.jpeg

754759B1-42BF-44F4-91BA-FEF014A23274.jpeg

Edited by Jammy B
Link to post
17 hours ago, IGHOR said:

You need to find out those values for your ups
default.battery.voltage.high =
default.battery.voltage.low =
default.battery.voltage.nominal =

 

so i've put these values into ups.conf and its now showing 100% battery on status.

 

so high = 27.50v [NUT says that that is current battery voltage now]

nominal = 24v

low = 21.4v

 

how do i go about doing a calibration? do i literally kill the power and watch the % drop?

Link to post
2 hours ago, Jammy B said:

do i literally kill the power and watch the % drop?

Yes, but with the server getting power from a different source so it stays running. Put a load roughly equivalent to the server on the UPS output, and turn off the power feeding the UPS but not the server (obviously).

You may need to tweak the battery voltage low value to match what value actually shows up in NUT a few seconds before the UPS shuts itself down from low battery. Once the UPS shuts itself off, turn the power back on with the dummy load running and time how long it takes to return the battery to voltage high so you know the recharge rate.

During this testing, make sure NUT is configured NOT to shut down the server.

Link to post
11 minutes ago, jonathanm said:

Yes, but with the server getting power from a different source so it stays running. Put a load roughly equivalent to the server on the UPS output, and turn off the power feeding the UPS but not the server (obviously).

You may need to tweak the battery voltage low value to match what value actually shows up in NUT a few seconds before the UPS shuts itself down from low battery. Once the UPS shuts itself off, turn the power back on with the dummy load running and time how long it takes to return the battery to voltage high so you know the recharge rate.

During this testing, make sure NUT is configured NOT to shut down the server.

got you.

 

will give this a whirl at the weekend. thanks for the help.

 

 

Link to post

How often does NUT poll the battery voltage?

 

after setting the high/nominal/low values. If I refresh the page the charge jumps between 97% to 100%
 

do I need to set a polling time?

Link to post
On 6/24/2021 at 4:32 PM, IGHOR said:

You need to find out those values for your ups
default.battery.voltage.high =
default.battery.voltage.low =
default.battery.voltage.nominal =


 

having an issue making the above settings persist in ups.conf

 

as you can see below. It’s disappeared. 
 

how do I keep them in the ups.conf file?

 

all works when in battery mode. 
 

edit

nothing works until I put it all back in. 

1C8A1C93-43C1-4370-BC80-5870B400B275.jpeg

Edited by Jammy B
Link to post
1 hour ago, IGHOR said:

You need to use manual config only

image.thumb.png.a7f6fab64283768ab7954b31738c2e2c.png

 

ahh

image.png.1a606ef1a623c72ba444def7ab7d7ba2.png

 

 

every days a school day.

 

will re-edit my ups.conf file and make sure its enabled.

 

thanks for the advice @IGHOR as always,.

 

Link to post

hi, I just get used to Unraid and installed the NUT plugin. I was wondering about the red "w":

306624537_Bildschirmfoto2021-06-28um13_10_34.thumb.png.6fb7243e7bc53e7a67b8e6172c3073d2.png

 

any hints how to get it working without any red warning signs? ;)

 

In Addition here are the automatically detected details of my APS UPS:

1903180557_Bildschirmfoto2021-06-28um13_10_16.thumb.png.eb6125fb39d90dc30285664783515e3c.png

Link to post
2 hours ago, nicx said:

hi, I just get used to Unraid and installed the NUT plugin. I was wondering about the red "w":

306624537_Bildschirmfoto2021-06-28um13_10_34.thumb.png.6fb7243e7bc53e7a67b8e6172c3073d2.png

 

any hints how to get it working without any red warning signs? ;)

 

In Addition here are the automatically detected details of my APS UPS:

1903180557_Bildschirmfoto2021-06-28um13_10_16.thumb.png.eb6125fb39d90dc30285664783515e3c.png

Is there any reason why you’re using NUT instead of the built in UPS manager in unraid?

 

APC works great with the built in one. It’s a couple items to the right of NUT settings. 

Link to post
19 minutes ago, Jammy B said:

Is there any reason why you’re using NUT instead of the built in UPS manager in unraid?

 

APC works great with the built in one. It’s a couple items to the right of NUT settings. 

I am using NUT because I need network access to the NUT server. And as far as I understand the integrated UPS manager is not able to do that.

Link to post

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.