Jump to content

[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

10 minutes ago, Rysz said:

 

Can you post your configuration (black out the passwords), the log you appended earlier makes me think it's a configuration issue. Access denied is usually due insufficient user permissions (misconfiguration) or wrong passwords.

 

Ok, so I removed the plugin and updated it to your 2.8.0 release, this has gotten rid of the Access Denied error. I believe I misinterpreted the error; it was actually triggering when I would start/restart the service. I see no errors when I try to connect the client to the server, WinNUT just hangs for about 30 seconds then says it cannot connect.

 

Here's my config, the log is attached:

 

MODE=netserver

 

[qnapups]
driver = usbhid-ups
port = auto

 

LISTEN 0.0.0.0

 

[admin]
password=*****
actions=set
actions=fsd
instcmds=all
[root]
password=*****
upsmon master
[admin]
password=****
upsmon slave

 

MONITOR [email protected] 1 root ***** master
SHUTDOWNCMD "/sbin/poweroff"
POWERDOWNFLAG /etc/nut/killpower
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYCMD "/usr/sbin/nut-notify"
NOTIFYFLAG REPLBATT SYSLOG+EXEC

 

 

 

 

NUT.txt

Link to comment
3 hours ago, darcon said:

 

Ok, so I removed the plugin and updated it to your 2.8.0 release, this has gotten rid of the Access Denied error. I believe I misinterpreted the error; it was actually triggering when I would start/restart the service. I see no errors when I try to connect the client to the server, WinNUT just hangs for about 30 seconds then says it cannot connect.

 

Here's my config, the log is attached:

 

MODE=netserver

 

[qnapups]
driver = usbhid-ups
port = auto

 

LISTEN 0.0.0.0

 

[admin]
password=*****
actions=set
actions=fsd
instcmds=all
[root]
password=*****
upsmon master
[admin]
password=****
upsmon slave

 

MONITOR [email protected] 1 root ***** master
SHUTDOWNCMD "/sbin/poweroff"
POWERDOWNFLAG /etc/nut/killpower
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYCMD "/usr/sbin/nut-notify"
NOTIFYFLAG REPLBATT SYSLOG+EXEC

 

 

 

 

NUT.txt 4.1 kB · 0 downloads

 

You made two admin users with differing rights... that makes no sense.

Also you shouldn't use existing user account names (like root) for all this, better do it like this:

 

upsd.users

[admin]
password=adminpass
actions=set
actions=fsd
instcmds=all
[monuser]
password=monpass
upsmon master
[slaveuser]
password=slavepass
upsmon slave

 

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"
NOTIFYFLAG REPLBATT SYSLOG+EXEC

 

and on WinNUT (in this example) you'll use username slaveuser and password slavepass.

You can change the passwords, of course, but I'd keep the usernames simple like that.

These are fictional users, they have nothing to do with your user accounts on UNRAID.

 

monuser = only the device the UPS is connected to (UNRAID)

slaveuser = all devices that should also shutdown (over network)

 

Edited by Rysz
Link to comment
23 hours ago, Rysz said:

 

You made two admin users with differing rights... that makes no sense.

Also you shouldn't use existing user account names (like root) for all this, better do it like this:

 

upsd.users

[admin]
password=adminpass
actions=set
actions=fsd
instcmds=all
[monuser]
password=monpass
upsmon master
[slaveuser]
password=slavepass
upsmon slave

 

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"
NOTIFYFLAG REPLBATT SYSLOG+EXEC

 

and on WinNUT (in this example) you'll use username slaveuser and password slavepass.

You can change the passwords, of course, but I'd keep the usernames simple like that.

These are fictional users, they have nothing to do with your user accounts on UNRAID.

 

monuser = only the device the UPS is connected to (UNRAID)

slaveuser = all devices that should also shutdown (over network)

 

 

It ended up being a misconfiguration on the VPN that particular host uses which was blocking LAN access. I did clean up my users, so thanks for that info.

  • Upvote 1
Link to comment
On 8/30/2023 at 7:35 AM, Rysz said:

 

Touché 🙃, but mine do at least offer the benefit of more than a year's worth of additional compatibility changes and bugfixes, so that's something I can live with considering the immense benefit for the end users.

 

If we're custom building packages now, which you all seemed to advocate for, I'd at least build them offering the latest changes and keep them up to date as much as possible.

 

Do you have packages compiled with both libsslv1.1 and v3 support, Thinking we can have a stable and dev option, but I will need two packages. 

 

ich777 is going to build me two packages.

Link to comment
Just now, rama3124 said:

Hi i already have the NUT plugin installed but just noticed there is a new version available from Rysz repository (Network UPS Tools (NUT) - CI). What does this CI version do differently and what does CI stand for? TIA

 

It's an alternative version with a different (newer) NUT backend and a few minor bugfixes, you can choose which one to use, but don't install two at the same time - I'll clarify this better in the application description.

Link to comment
7 minutes ago, Rysz said:

 

It's an alternative version with a different (newer) NUT backend and a few minor bugfixes, you can choose which one to use, but don't install two at the same time - I'll clarify this better in the application description.

Makes sense. Is there a recommended way to migrate from the original plugin to your new one?

Link to comment

For the record, I found the problem. Not sure what caused the instant shutdowns, but reinstalling NUT - I mean removing it, restarting, installing it and restarting again - fixed it. The other issue was probably caused by unraid's integrated UPS config - it was enabled and configured for usbhid as well, and I vaguely remember that it sortofkindof works with this eaton. It probably caused the orignal issue as well. Not sure how it got enabled, maybe I mixed it up with NUT at some point and didn't realize the error.

 

Oh, and I've also updated to 6.12.4, that could also be a factor

On 8/30/2023 at 11:00 PM, andris said:

Hi,

 

I have an Eaton 5e 850i, which works through the usbhid-ups protocol. Recently (not sure when it started), it shuts down about a minute after power is out ignoring the settings.

[...]

Edit: I think my ups does something funky when power comes back as well. I did a clear reinstall of NUT from CA, and it seemed to fix the issue - but when I turn back power, communication with the UPS is lost, with this in the syslog:

 

  • Like 1
Link to comment

How do I set the IP address when set to SNMP-UPS?  The APCUPSD detected SNMP right the first time.  I an unable to edit 127.0.0.1.

 

Nevermind... got it working. 

 

ups.conf

```

[apc1500]
driver = snmp-ups
port = 192.168.1.197
pollfreq = 15
community = private
snmp_version = v2c

```

Edited by mattw
  • Like 1
Link to comment
21 hours ago, Rysz said:

 

It's an alternative version with a different (newer) NUT backend and a few minor bugfixes, you can choose which one to use, but don't install two at the same time - I'll clarify this better in the application description.

Hi,

I have a suggestion to enhance your plugin, at last for me...

My UPS when it's connected to power always display status as:

ups.status: OL CHRG

So the footer icon always is displayed as battery charging even if battery charge is 100%. I think that if value of battery.charge is 100 you should display icon as battery-full and not battery-charging. This can be easily done when you select the icon to display adding a check.

Also in this way I get a chance to get the replacement battery icon, now it will never be displayed in my UPS.

 

Thanks for your work

Best Regards,

 

 

Edited by yonesmit
Link to comment
1 minute ago, ich777 said:

@Rysz thanks for creating a new plugin.

May I ask what is the difference between your plugin and the one from @SimonF?

Just asking because users maybe get confused when they find two plugins.

He explained it here:

 

I need to use it because the is the only 2.80 version that works correctly with my  UPS.

 

 

Edited by yonesmit
  • Thanks 1
Link to comment

I'm in contact with Simon regarding the future of his plugin, right now mine's just "my alternative" with a more up to date backend (built from a recent master branch state), some bugfixes and a re-factored code base, which users can choose to use if they wish - just like Plex has different versions for example.

 

For a full list of changes, basically anything in the changelog from 26/07/2023 onwards is different in my version - probably best to just compare or test it out.

 

Seeing as NUT is a continuous integration project with a very irregular "stable" release schedule (sometimes spanning many months to more than a year), I feel it's currently best to offer users the latest updates from the master branch as opposed to updating the backend not once in more than a year (last "stable" was back in 05/2022 and tons of quality of life changes have been made since then).

 

Users can always choose to stay on a version they feel well with, but I feel it'd be unfair to not offer the latest updates which might offer fixes for users with game-stopper type problems. I've been following the NUT development very closely and it's very reasonable and careful in nature, so I feel things are very unlikely to just "break" between any such backend updates.

 

I might offer both a stable and developmental branch to choose from in the future, but not at the moment as I feel 2.8.0 "stable" is just too ancient compatibility-wise at this point and 2.8.1 is already on the horizon.

 

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

I might offer both a stable and developmental branch to choose from in the future, but not at the moment as I feel 2.8.0 "stable" is just too ancient compatibility-wise at this point and 2.8.1 is already on the horizon.

Can you please be a bit more clear in these two points:

  1. Do you plan to overtake further development of the plugin
  2. Do you plan to offer the latest stable branch too (regardless how old it is) alongside with a build from the latest master branch

 

I'm just trying if it is worth to switch over to the new plugin because the old one is working just fine and for me personally I want to stay on the stable branch regardless how old it is because for me it is working.

 

The next thing is that it would be beneficial to other users to see that this plugin is built from the latest master branch which in it's current form it doesn't tell and that it is a alternative to the existing plugin:grafik.thumb.png.7a6a444f05c735d8ec22ba514c1a34f9.png

 

Don't get me wrong, I just want to clarify things and not that experienced users can get confused by two basically "identical" plugins.

Link to comment
1 minute ago, ich777 said:

Can you please be a bit more clear in these two points:

  1. Do you plan to overtake further development of the plugin
  2. Do you plan to offer the latest stable branch too (regardless how old it is) alongside with a build from the latest master branch

 

I literally described my vision for my "flavour" of the project above, nobody is forcing anyone to use it over Simon's version and it's his decision how he'll proceed with his fork.

 

What's your end game with these questions, did I miss something on my end here? I'm just trying to offer users an alternative.

Link to comment
1 minute ago, Rysz said:

What's your end game with these questions, did I miss something on my end here? I'm just trying to offer users an alternative.

I've edited my post, please don't get me wrong about my questions. I just want to clarify things for not that experienced users and I not only see that from my perspective.

 

BTW I'm also not mad or anything like that if you build the packages, I'm more than happy if anyone else does it because that means more free time for me... :)

Link to comment

My version will follow the master branch more closely in general, with extensive testing and consideration by me before updating (so no blind pushing). It's designed to provide an alternative to Simon's plugin which users can choose to remain on if they feel it works well for them. I feel both the description in combination with the changelog would allow any more interested users to make a sufficently informed choice (probably more so than with many other plugins on CA). In general though, from my impression following the more than cautious NUT development these past months, users will likely not even notice a change in the backend unless they were having problems which suddenly become resolved - hence me not going further into detail on this in the description. If Simon should decide to deprecate his version, which is entirely his decision, I'll consider providing a legacy branch for users wishing to remain on the older "stables". Until then, they can choose from the multiple versions available as with most other popular plugins on CA. No offense intended and none taken from my side as well. 🙂

  • Like 1
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...