Difference between revisions of "Setting up a NUT Server"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
(Created page with "fffff")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
fffff
= Install NUT =
 
* <code>sudo apt install nut</code>
 
== Select your mode ==
* <code>sudo vi /etc/nut/nut.conf</code>
 
(In my case, I've installed NUT on a VM and it'll be managing the UPS for the whole server...)
MODE=netserver
 
== Select your hardware ==
* <code>sudo vi /etc/nut/ups.conf</code>
 
[cyberpower]
        driver = usbhid-ups
        port = auto
        desc = "A random surplus UPS"
 
(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 ups.conf documentation] for more details.
 
== Start & test ==
* <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 ==
(needed if you've set up as '''MODE = netserver'''...)
 
You can determine your servers IP address using:
* <code>ip a</code>
* <code>sudo vi /etc/nut/upsd.conf</code>
LISTEN '''192.168.0.7'''        # Actual IP
LISTEN 127.0.0.1 3493      # Localhost
LISTEN ::1 3493            # IPv6
Where '''192.168.0.7'''&nbsp;should be replaced with the actual IP of the machine.
 
See [https://networkupstools.org/docs/man/upsd.conf.html the upsd.conf documentation] for more details.
 
== Set up access ==
* <code>sudo vi /etc/nut/upsd.users</code>
[upsmon]
    password = supersecretpassword
    upsmon primary
 
(primary used to be "upsmon master", but the PC police got to it.)
 
See [https://networkupstools.org/docs/man/upsd.users.html the upsd.users documentation] for more details.
 
* <code>sudo vi /etc/nut/upsmon.conf</code>
 
MONITOR cyberpower@ups.server.tld 1 monuser supersecretpassword primary
 
(where '''ups.server.tld''' is the name or IP of your NUT server.)
 
See [https://networkupstools.org/docs/man/upsmon.conf.html the upsmon.conf documentation] for more details.
 
 
[[Category:IT]]
[[Category:Hardware Management]]
[[Category:Linux]]
[[Category:WIP]]

Latest revision as of 19:03, 24 November 2023

Install NUT

  • sudo apt install nut

Select your mode

  • sudo vi /etc/nut/nut.conf

(In my case, I've installed NUT on a VM and it'll be managing the UPS for the whole server...)

MODE=netserver

Select your hardware

  • sudo vi /etc/nut/ups.conf
[cyberpower]
       driver = usbhid-ups
       port = auto
       desc = "A random surplus UPS"

(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

(needed if you've set up as MODE = netserver...)

You can determine your servers IP address using:

  • ip a
  • sudo vi /etc/nut/upsd.conf
LISTEN 192.168.0.7         # Actual IP
LISTEN 127.0.0.1 3493      # Localhost
LISTEN ::1 3493            # IPv6

Where 192.168.0.7 should be replaced with the actual IP of the machine.

See the upsd.conf documentation for more details.

Set up access

  • sudo vi /etc/nut/upsd.users
[upsmon]
    password = supersecretpassword
    upsmon primary

(primary used to be "upsmon master", but the PC police got to it.)

See the upsd.users documentation for more details.

  • sudo vi /etc/nut/upsmon.conf
MONITOR cyberpower@ups.server.tld 1 monuser supersecretpassword primary

(where ups.server.tld is the name or IP of your NUT server.)

See the upsmon.conf documentation for more details.