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?
Nagios XI - Cisco port status check with Negate
Re: Nagios XI - Cisco port status check with Negate
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.
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Nagios XI - Cisco port status check with Negate
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
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
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
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.
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
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
Things always work better when they're doing what you expect. 
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
Excellent, glad it is resolved!
Locking
Locking