I am monitoring the status of a switch port that is down by default and I would like to be notified when it is up. Is there any way to "reverse" the OK/Critical messages so that when the port is down that is OK and when it is up that is Critical?
The port is connected to the backup controller on our SAN, so it would only turn on if the primary controller failed.
The current check command is using check_ifoperstatus. We are running Nagios XI 2012R1.3 on CentOS 6.3.
Notify when port is up
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Notify when port is up
You should be able to perform this with the negate plugin. You will need to create a command using it and apply it to your current check. This could be done either by creating a command definition simply with $USER1$/negate -s then adding the rest in that specific check, or creating a more specific command such as $USER1$/negate -s $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 that would be used only to negate ping commands.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Notify when port is up
Thank you for that information. I'm very new to Nagios XI, is there a way to modify that check in the Core Config Manager GUI?
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Notify when port is up
Welcome to the Nagios community! Yes there is, within CCM on the right hand side, go to commands->commands. Then you can choose to modify the existing negate command definition and make it active as well as defining it as $USER1$/negate or you can create a new one specifically for your needs and define more like above. An example would be:
This would then be available in the drop down list in XI check commands, and can be easily configured for any object within XI, also having the advantage of using arg1 and arg2 per normal check_ping documentation. It would simply inverse the result of the command. If you chose the more generic version, on your host or service check you would need to paste a $USER1$/[check_command]!check_ping![hostaddress]![warning value]![critical value]![number of packets]
Code: Select all
Command Name: Negate Ping
Command Line: $USER1$/negate $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
Command Type: Check Command
Active: Checked
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Notify when port is up
Excellent! Thank you for your help.