[Nut-upsuser] Monitoring slaves via dummy-ups

Dan Langille dan at langille.org
Fri Sep 4 21:07:45 BST 2020


Hello,

I wondered how folks monitored slaves.

In my case, I am using Nagios and the check_ups plugin. It seems to work fine but being new to nut, I'm seeking confirmation that this is a sane approach.

The goal: confirm the slaves have contact with the master.

The environment:

* FreeBSD 12.1
* nut-2.7.4 installed from package

Background:

I am replacing an APC 2200 UPS (still in use) with an Eaton 5PX (5PX2200RT) and an external battery pack (5PXEBM48RT). I'll be doing that changeover tomorrow morning. That is why you'll see load=0 below. The Eaton is powered on, but not powering anything. That comes tomorrow.

This is the command line check:

$ /usr/local/libexec/nagios/check_ups -H 10.0.0.18 -u ups02
UPS OK - Status=Online Utility=116.5V Batt=100.0% Load=0.0% Left=157.5min|voltage=116.500000;;;0.000000 battery=100.000000%;;;0.000000;100.000000 load=0.000000%;;;0.000000;100.000000 left=157.466667;;;0.000000

where 10.0.0.18 is the slave I want to check and ups02 is the Eaton connected to bast.example.org

On each slave, I have this configuration (see https://github.com/dlangille/nut_config):

nut.conf:
MODE=netclient


ups.conf:
# see https://networkupstools.org/docs/man/dummy-ups.html
# under repeater mode
[ups02]
driver = dummy-ups
# this is the master
port = ups02 at bast.example.org
desc = "dummy-ups in repeater mode"


upsd.conf:
LISTEN 127.0.0.1
LISTEN ::1
LISTEN 10.0.0.18
LISTEN 2001:db8::1


upsmon.conf:
# yes, there is no shutdown in there yet, this is just testing so far
MONITOR ups02 at bast.example.org 1 slocum abcd slave


ups.conf exists so check_ups can connect & verify that this host has comms with the master.

I'll also create checks to verify the following processes are running:

The pid files are here:

$ sudo ls -l /var/db/nut
total 6
srw-rw----  1 uucp  uucp  0 Sep  3 20:07 dummy-ups-repeater
-rw-r--r--  1 uucp  uucp  6 Sep  3 20:07 dummy-ups-repeater.pid
srw-rw----  1 uucp  uucp  0 Sep  3 20:14 dummy-ups-ups02
-rw-r--r--  1 uucp  uucp  6 Sep  3 20:14 dummy-ups-ups02.pid
-rw-r--r--  1 uucp  uucp  6 Sep  3 20:14 upsd.pid
-rw-r--r--  1 root  uucp  6 Sep  4 19:49 upsmon.pid

Later, I'll create checks to verify that ups & upsmon are both running.

So far, this seems to work great.

But it is sane?

Thank you.

-- 
  Dan Langille
  dan at langille.org



More information about the Nut-upsuser mailing list