Hi!
How can I change error codes of "No route to host" and "Connection refused or timed out" notifications from critical to warning?
Changing "No route to host" error code from Crit to Warn
-
KKoovalsky
- Posts: 2
- Joined: Tue Nov 08, 2016 6:27 am
Re: Changing "No route to host" error code from Crit to Warn
Usually, you'll need to write a wrapper script to sit in front of the plugin to handle the logic for if it detects that text.
It might be built in with the plugin, though - which plugin are you using?
It might be built in with the plugin, though - which plugin are you using?
Former Nagios Employee
-
KKoovalsky
- Posts: 2
- Joined: Tue Nov 08, 2016 6:27 am
Re: Changing "No route to host" error code from Crit to Warn
I'm using check_ping. Inside check_ping.cfg I have service check_host_alive with this plugin used with -c arg not optional. I tried to call check_ping with -c 101%, but this doesn't work.
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: Changing "No route to host" error code from Crit to Warn
Developing custom plugins is really out of scope for support but we can tell you how it works.
Your wrapping plugin needs to sit as a shim between the standard check_ping and Nagios. The custom plugin will execute check_ping and process the data. If it gets text like No route to host or Connection refused or timed out then the custom plugin needs to exit with a return code of 1 instead of 2 as the standard plugin would do.
Your wrapping plugin needs to sit as a shim between the standard check_ping and Nagios. The custom plugin will execute check_ping and process the data. If it gets text like No route to host or Connection refused or timed out then the custom plugin needs to exit with a return code of 1 instead of 2 as the standard plugin would do.
Previous Nagios employee