Make switch port status always OK

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Make switch port status always OK

Post by adam.sage »

Is there a way to modify how switch port status is determined? I have quite a few switches that have many ports unplugged I would like to see the status as OK if the interface is up or down. Basically I just want to be able to see if the interface is up or down but not be alerted if it is down. If I can do this through the template that would be even better yet.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Make switch port status always OK

Post by tmcdonald »

You would need to write a wrapper script that calls your port monitoring script and passes the output through but keeps the exit code as 0 for OK. This is literally about 3 lines in a bash script:

Code: Select all

#!/bin/sh
/path/to/script -arg val -arg val
exit 0
Former Nagios employee
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Re: Make switch port status always OK

Post by adam.sage »

So just run that script once and its done? And if I ever want to go back to the default, what do I change exit 0 to?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Make switch port status always OK

Post by abrist »

You would have to remove the wrapper and go back to the standard check. You could also use the negate plugin:
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Make switch port status always OK

Post by tmcdonald »

You would run this new script in lieu of the actual port monitoring script, so in the CCM you would point the service or template to a command that runs this new script. If you want to go back to the old way, you just switch the template back to using the original command.

And bear in mind that the negate plugin will make your OK into CRITICAL and vice-versa. If you just want OK, use the method I have described.
Former Nagios employee
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Re: Make switch port status always OK

Post by adam.sage »

Ok, I'll do some testing with it next week. I'm sure I'll have more questions then.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Make switch port status always OK

Post by abrist »

righto, talk to you next week!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked