Difference between revisions of "UPS Handling with NUT"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
Line 27: Line 27:
= Configure NUT =
= Configure NUT =


== Select your mode ==
* <code>sudo vi /etc/nut/nut.conf</code>
* <code>sudo vi /etc/nut/nut.conf</code>
  MODE=netserver
  MODE=netserver
== Select your hardware ==
* <code>sudo vi /etc/nut/ups.conf</code>
* <code>sudo vi /etc/nut/ups.conf</code>
  [cyberpower]
  [cyberpower]
         driver = usbhid-ups
         driver = usbhid-ups
         port = auto
         port = auto
== Start & test ==
* <code>sudo upsdrvctl start</code>
* <code>sudo upsdrvctl start</code>
* <code>ip a</code>
* <code>ip a</code>
== Set up communications ==
* <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
  LISTEN 127.0.0.1 3493
  LISTEN 127.0.0.1 3493
  LISTEN ::1 3493
  LISTEN ::1 3493
== Set up access ==
* <code>sudo vi /etc/nut/upsd.users</code>
* <code>sudo vi /etc/nut/upsd.users</code>
  [upsmon]
  [upsmon]
Line 44: Line 53:
         upsmon master
         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


= Manage NUT =
= Manage NUT =

Revision as of 20:06, 3 February 2022

Proven on:
Logo Debian.png
11 (bullseye)


As always...

Start with:

  • sudo apt update
  • sudo apt upgrade

Network UPS Tools

Install NUT

  • sudo apt install nut

Configure NUT

Select your mode

  • sudo vi /etc/nut/nut.conf
MODE=netserver

Select your hardware

  • sudo vi /etc/nut/ups.conf
[cyberpower]
       driver = usbhid-ups
       port = auto

Start & test

  • sudo upsdrvctl start
  • ip a

Set up communications

  • 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