Computing/NUT: Difference between revisions

From Cricalix.Net
mNo edit summary
mNo edit summary
Line 7: Line 7:


=== Configuration ===
=== Configuration ===
For the Eaton Pro UPS, '''/etc/nut/ups.conf'''<syntaxhighlight lang="ini">
For the Eaton Pro UPS, '''/etc/ups/ups.conf'''<syntaxhighlight lang="ini">
[eaton650]
[eaton650]
         driver = "usbhid-ups"
         driver = "usbhid-ups"
         port = "auto"
         port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        vendor = "EATON"
        bus = "005"
</syntaxhighlight>Vendorid/productid/vendor/bus are not critical for single use case.


Then '''/etc/nut/upsd.conf'''<syntaxhighlight lang="bash">
</syntaxhighlight>'''/etc/ups/upsd.conf'''<syntaxhighlight lang="bash">
LISTEN 127.0.0.1 3493
LISTEN * 3493
LISTEN ::1 3493
 
</syntaxhighlight>And finally, '''/etc/nut/nut.conf'''<syntaxhighlight>
</syntaxhighlight>All other files were left at defaults from the RPM installs, bar this detritus from a polkit adventure - it may or may not still apply<syntaxhighlight>
MODE=standalone
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.systemd1.manage-units" &&
        subject.user == "nut") {
        return polkit.Result.YES;
    }
});
 
</syntaxhighlight>
 
=== udev ===
<syntaxhighlight>
ATTR{idVendor}=="0463", ATTR{idProduct}=="ffff", MODE="664", GROUP="nut"
 
</syntaxhighlight>
</syntaxhighlight>


=== Runtime ===
== Runtime ==
<syntaxhighlight>
<syntaxhighlight>
systemctl start nut-server
systemctl start nut-server
</syntaxhighlight>The script behind nut-server will spin up new systemctl services to handle the UPS.
</syntaxhighlight>The script behind nut-server will spin up new systemctl services to handle the UPS.


NUT Monitor can be run to get a graphical interface to the UPS status.
== Troubleshooting ==
 
Previous attempts got stuck on custom UPS definitions in systemd, with permissions not setting up correctly etc. Ended up blowing everything away and restarting from scratch with the NUT enumerator approach.
Using NUT will disable KDE's ability to communicate with the UPS and show the state of charge.
 
=== Alternate installation ===
Set MODE=netclient in /etc/nut/nut.conf
 
No entry in /etc/nut/ups.conf
 
Add a MONITOR ups@synologyip 0 monuser secret secondary to upsmon.conf
 
Set MINSUPPLIES to 0 in upsmon.conf
 
systemctl restart nut-monitor

Revision as of 17:16, 2 April 2026

Network UPS

Installation

apt install nut nut-monitor

Configuration

For the Eaton Pro UPS, /etc/ups/ups.conf

[eaton650]
        driver = "usbhid-ups"
        port = "auto"

/etc/ups/upsd.conf

LISTEN * 3493

All other files were left at defaults from the RPM installs, bar this detritus from a polkit adventure - it may or may not still apply

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.systemd1.manage-units" &&
        subject.user == "nut") {
        return polkit.Result.YES;
    }
});

udev

ATTR{idVendor}=="0463", ATTR{idProduct}=="ffff", MODE="664", GROUP="nut"

Runtime

systemctl start nut-server

The script behind nut-server will spin up new systemctl services to handle the UPS.

Troubleshooting

Previous attempts got stuck on custom UPS definitions in systemd, with permissions not setting up correctly etc. Ended up blowing everything away and restarting from scratch with the NUT enumerator approach.