Switch port status monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rdobbsmacu
Posts: 36
Joined: Tue Apr 28, 2015 3:11 pm

Switch port status monitoring

Post by rdobbsmacu »

I am trying to figure out how to setup nagios xi to monitor switch port status and only notify me when the ports go from down to up so i'm notified when someone plugs something into a switch port on my network. Also how to setup nagios xi so all the down ports are not showing or being listed as a problem. That being said there are some ports I do what to be notified on if they go from up to down, like my servers and trunk ports between switches.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Switch port status monitoring

Post by Box293 »

negate is your answer.

For example, check_dummy producing a critical state

Code: Select all

/usr/local/nagios/libexec/check_dummy 2 "Port is down"
CRITICAL: Port is down

echo $?
2

Now let's use negate for check_dummy

Code: Select all

/usr/local/nagios/libexec/negate -s /usr/local/nagios/libexec/check_dummy 2 "Port is down"
OK: Port is down

echo $?
0
Does this make sesne?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Switch port status monitoring

Post by jdalrymple »

You need to be introduced to the negate plugin.

It is useful anytime the desired outcome is opposite or at least different than what the plugin assumes.
rdobbsmacu
Posts: 36
Joined: Tue Apr 28, 2015 3:11 pm

Re: Switch port status monitoring

Post by rdobbsmacu »

yes that does make sense. Question before I do this, will this make all my ports that are up and showing OK go to showing as critical?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Switch port status monitoring

Post by Box293 »

Yes.

To avoid this you need to create a separate check command for the ones that you want to use negate with. Then update the specific services to use the negate command.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked