Nagios XI - Cisco port status check with Negate

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
eviernes
Posts: 4
Joined: Tue May 15, 2018 10:01 am

Nagios XI - Cisco port status check with Negate

Post 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?
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Nagios XI - Cisco port status check with Negate

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
eviernes
Posts: 4
Joined: Tue May 15, 2018 10:01 am

Re: Nagios XI - Cisco port status check with Negate

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Cisco port status check with Negate

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
eviernes
Posts: 4
Joined: Tue May 15, 2018 10:01 am

Re: Nagios XI - Cisco port status check with Negate

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Cisco port status check with Negate

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
eviernes
Posts: 4
Joined: Tue May 15, 2018 10:01 am

Re: Nagios XI - Cisco port status check with Negate

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Nagios XI - Cisco port status check with Negate

Post by eloyd »

Things always work better when they're doing what you expect. :-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Cisco port status check with Negate

Post by scottwilkerson »

Excellent, glad it is resolved!

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked