Page 1 of 1

Nagios XI - Cisco port status check with Negate

Posted: Tue May 15, 2018 10:15 am
by eviernes
In order to monitor unused ports for something being plugged into it I created the Negate version of the status check. This also replaces the critical icons in the GUI with the green OK.

$USER1$/negate -s "$USER1$/check_ifoperstatus -H $HOSTADDRESS$ -C $ARG1$ -k $ARG2$ $ARG3$

Every few minutes the status information of the port will say port down like it is supposed to, but the status changes from Critical to OK then back to Critical again. The ports are not flapping. Is there another nagios check happening on the port other than my negate check?

Re: Nagios XI - Cisco port status check with Negate

Posted: Tue May 15, 2018 1:31 pm
by eloyd
You would have to tell us if there's another check or not. It's not something Nagios does automatically; you have to set it up (intentionally or otherwise). Take a look at the alert log and see if it matches when you expect it to go OK or CRITICAL.

Re: Nagios XI - Cisco port status check with Negate

Posted: Tue May 15, 2018 1:40 pm
by eviernes
I'll check the logs. This is a NagiosXI virtual machine, deployed from the ova and only added Cisco switches with the wizard. Then updated the service checks on a few interfaces for the negate.

Re: Nagios XI - Cisco port status check with Negate

Posted: Tue May 15, 2018 2:25 pm
by scottwilkerson
If you just updated the check command to use the negated command there isn't any other checks being performed except MRTG would still be polling the interface for bandwidth usage.

Re: Nagios XI - Cisco port status check with Negate

Posted: Tue May 15, 2018 2:30 pm
by eviernes
Just found something interesting, while it is in the Critical state, the duration is the time from when I first added the device. When it goes to green, the duration shows the time since I switched it to use the negate command. Could this be database corruption?

Re: Nagios XI - Cisco port status check with Negate

Posted: Tue May 15, 2018 2:37 pm
by scottwilkerson
The time is from "state change"
So it was CRITICAL when you added the device, but the negate plugin is changing the state to actually be OK

This has nothing to do with the text displayed in the output, but the underlying exit code of the plugin.

Re: Nagios XI - Cisco port status check with Negate

Posted: Wed May 16, 2018 11:43 am
by eviernes
Got it. There was a second instance of Nagios running. I killed it and restarted nags services, checks running and reporting as expected.

Re: Nagios XI - Cisco port status check with Negate

Posted: Wed May 16, 2018 12:13 pm
by eloyd
Things always work better when they're doing what you expect. :-)

Re: Nagios XI - Cisco port status check with Negate

Posted: Wed May 16, 2018 12:27 pm
by scottwilkerson
Excellent, glad it is resolved!

Locking