Difference between revisions of "NUT"

From Mark Furneaux's Wiki
Jump to: navigation, search
(Created page with "'''NUT''', or Network UPS Tools, is a system for monitoring UPSes over a network. ==Installation== Install NUT with:<br> <code># apt install nut</code> ==Configuration== ===...")
 
Line 70: Line 70:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
MONITOR cp1500pfclcd@192.168.30.100 1 upsmonuserslave <passwd> slave
 
MONITOR cp1500pfclcd@192.168.30.100 1 upsmonuserslave <passwd> slave
 +
</syntaxhighlight>
 +
 +
Optionally set a notify command and set the notify types in <code>/etc/nut/upsmon.conf</code>:<br>
 +
<syntaxhighlight lang="bash">
 +
NOTIFYCMD /usr/local/bin/upschange.sh
 +
 +
NOTIFYFLAG ONBATT      SYSLOG+WALL+EXEC
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
Start the monitor with:<br>
 
Start the monitor with:<br>
 
<code># systemctl start nut-monitor.service</code>
 
<code># systemctl start nut-monitor.service</code>

Revision as of 17:45, 9 May 2017

NUT, or Network UPS Tools, is a system for monitoring UPSes over a network.

Installation

Install NUT with:
# apt install nut

Configuration

Server

Add a UPS driver in /etc/nut/ups.conf:

[cp1500pfclcd]
      driver = usbhid-ups
      port = auto
      desc = "tesla"
      sdorder = -1

You will need to comment out maxretry = 3 since it is not supported by upshid-ups.

Start the driver with:
# upsdrvctl start

Add the addresses to listen on in /etc/nut/upsd.conf:

LISTEN 127.0.0.1 3493
LISTEN ::1 3493
LISTEN 192.168.30.100 3493
LISTEN 192.168.10.100 3493

Set the operating mode in /etc/nut/nut.conf:

MODE=netserver

Create 2 users in /etc/nut/upsd.users:

[upsmonuser]
        password = <passwd>
        actions = SET FSD
        instcmds = ALL
        upsmon master

[upsmonuserslave]
        password = <passwd>
        upsmon slave

Setup a monitor on the master in /etc/nut/upsmon.conf:

MONITOR cp1500pfclcd@localhost 1 upsmonuser <passwd> master

Tear down the temporary daemons:
# upsd -c stop
# upsdrvctl stop

Start the daemon with:
# systemctl start nut-server.service

Start the monitor with:
# systemctl start nut-monitor.service

Client

Set the operating mode in /etc/nut/nut.conf:

MODE=netclient

Setup a monitor on the master in /etc/nut/upsmon.conf:

MONITOR cp1500pfclcd@192.168.30.100 1 upsmonuserslave <passwd> slave

Optionally set a notify command and set the notify types in /etc/nut/upsmon.conf:

NOTIFYCMD /usr/local/bin/upschange.sh

NOTIFYFLAG ONBATT       SYSLOG+WALL+EXEC

Start the monitor with:
# systemctl start nut-monitor.service