Difference between revisions of "UPS Handling with NUT"
Jump to navigation
Jump to search
Line 47: | Line 47: | ||
{{!}} style="width: 90.175px;" {{!}} '''netclient''' | {{!}} style="width: 90.175px;" {{!}} '''netclient''' | ||
{{!}} style="width: 619.15px;" {{!}} This MODE is for client machines that will access a NUT server | {{!}} style="width: 619.15px;" {{!}} This MODE is for client machines that will access a NUT server | ||
{{!}}} | {{!}}}<p class="mwt-heading">See [https://networkupstools.org/docs/man/nut.conf.html the nut.conf documentation] for more details.</p> | ||
== Select your hardware == | == Select your hardware == | ||
* <code>sudo vi /etc/nut/ups.conf</code> | * <code>sudo vi /etc/nut/ups.conf</code> | ||
[cyberpower] | [cyberpower] | ||
driver = usbhid-ups | |||
port = auto | |||
(In my case, I'm setting up a [https://www.cyberpowersystems.com/product/ups/intelligent-lcd/cp1000avrlcd/ CyberPower 1000AVR] & connecting it by passing USB through to the VM...) | (In my case, I'm setting up a [https://www.cyberpowersystems.com/product/ups/intelligent-lcd/cp1000avrlcd/ CyberPower 1000AVR] & connecting it by passing USB through to the VM...) | ||
If your UPS isn't handled natively by the '''usbhid-ups''' driver, or you need to set options, start with [https://networkupstools.org/docs/man/ups.conf.html the documentation] for more details. | If your UPS isn't handled natively by the '''usbhid-ups''' driver, or you need to set options, start with [https://networkupstools.org/docs/man/ups.conf.html the ups.conf documentation] for more details. | ||
== Start & test == | == Start & test == | ||
* <code>sudo upsdrvctl start</code> | * <code>sudo upsdrvctl start</code> | ||
You should see: | |||
Network UPS Tools - UPS driver controller 2.7.4 | |||
Network UPS Tools - Generic HID driver 0.41 (2.7.4) | |||
USB communication driver 0.33 | |||
Possibly followed by a bit of information about your UPS | |||
== Set up communications == | |||
* <code>ip a</code> | * <code>ip a</code> | ||
* <code>sudo vi /etc/nut/upsd.conf</code> | * <code>sudo vi /etc/nut/upsd.conf</code> | ||
LISTEN 192.168.2.219 | LISTEN 192.168.2.219 | ||
Line 71: | Line 80: | ||
* <code>sudo vi /etc/nut/upsd.users</code> | * <code>sudo vi /etc/nut/upsd.users</code> | ||
[upsmon] | [upsmon] | ||
password = supersecretpassword | |||
upsmon master | |||
* <code>sudo vi /etc/nut/upsmon.conf</code> | * <code>sudo vi /etc/nut/upsmon.conf</code> | ||
MONITOR myups@192.168.2.219 1 monuser supersecretpassword master | MONITOR myups@192.168.2.219 1 monuser supersecretpassword master |
Revision as of 20:44, 3 February 2022
11 (bullseye) |
|
As always... | |
---|---|
Start with: |
|
Install NUT
sudo apt install nut
Configure NUT
Select your mode
sudo vi /etc/nut/nut.conf
MODE=netserver
(In my case, I've installed NUT on a VM and it'll be managing the UPS for the whole server...)
none |
Disable automatic startup of NUT |
standalone | This MODE is for local only configuration |
netserver | This MODE is open to the network. (A NUT server) |
netclient | This MODE is for client machines that will access a NUT server |
See the nut.conf documentation for more details.
Select your hardware
sudo vi /etc/nut/ups.conf
[cyberpower] driver = usbhid-ups port = auto
(In my case, I'm setting up a CyberPower 1000AVR & connecting it by passing USB through to the VM...)
If your UPS isn't handled natively by the usbhid-ups driver, or you need to set options, start with the ups.conf documentation for more details.
Start & test
sudo upsdrvctl start
You should see:
Network UPS Tools - UPS driver controller 2.7.4 Network UPS Tools - Generic HID driver 0.41 (2.7.4) USB communication driver 0.33
Possibly followed by a bit of information about your UPS
Set up communications
ip a
sudo vi /etc/nut/upsd.conf
LISTEN 192.168.2.219 LISTEN 127.0.0.1 3493 LISTEN ::1 3493
Set up access
sudo vi /etc/nut/upsd.users
[upsmon] password = supersecretpassword upsmon master
sudo vi /etc/nut/upsmon.conf
MONITOR myups@192.168.2.219 1 monuser supersecretpassword master
Manage NUT
sudo service nut-server restart
sudo service nut-server status
upsc cyberpower
upscmd -l cyberpower