Make switch port status always OK
Make switch port status always OK
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.
Re: Make switch port status always OK
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
Re: Make switch port status always OK
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?
Re: Make switch port status always OK
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
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.
"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.
Re: Make switch port status always OK
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.
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
Re: Make switch port status always OK
Ok, I'll do some testing with it next week. I'm sure I'll have more questions then.
Re: Make switch port status always OK
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.
"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.