Page 1 of 1

Switch port status monitoring

Posted: Tue Apr 28, 2015 3:35 pm
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.

Re: Switch port status monitoring

Posted: Tue Apr 28, 2015 3:39 pm
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?

Re: Switch port status monitoring

Posted: Tue Apr 28, 2015 3:40 pm
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.

Re: Switch port status monitoring

Posted: Tue Apr 28, 2015 3:50 pm
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?

Re: Switch port status monitoring

Posted: Tue Apr 28, 2015 3:52 pm
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.