[Nut-upsuser] how do you test (nagios) that upsmon is connected?

Stuart Gathman stuart at gathman.org
Sat Apr 1 19:41:49 UTC 2017


On 04/01/2017 03:14 PM, Dan Craciun wrote:
> On my Nagios monitoring system I use check_nut_plus (that in turn
> calls upsc) to monitor the status (ups.status), load (ups.load),
> battery charge (battery.charge) and runtime (battery.runtime).
>
> If these return "unknown", it means upsd is no longer monitoring the
> UPS. As long as you get data, upsd is working.
>
> PS: as an example, this is my check for the status:
> /usr/bin/perl -w $USER$/check_nut_plus -d $ARG1$@$HOSTADDRESS$ -v
> 'ups.status=c!~^OL'
That's great, but Spike wants to know whether *upsmon* is working.  He
already has a way to check that upsd is working.

I don't have a complete solution, but I use NOTIFYCMD in upsmon.conf to
run upssched.  As part of upssched.conf, I append NOCOMM (and COMMOK)
events to a log file.  If NOCOMM in ups.log is not followed by COMMOK,
then upsmon will not shut down the system.  NOPARENT should probably be
logged also, as that makes upsmon unable to shutdown the system.

I agree that this "no news is good news" policy is not ideal - but I've
found it much more effective that no monitoring.

Note this also - if upsmon can't check UPS status, then nagios almost
certainly can't either.

To test, set up upsmon on a remote machine, and block 3493/tcp (nut) in
the firewall on the machine running upsd.  Nagios should scream.




More information about the Nut-upsuser mailing list