Page 1 of 2

check_icmp not changing host status

Posted: Tue Jun 21, 2016 6:13 am
by jmill17
When running the check_icmp plugin, I am getting a return of Critical - rta nan or 0.00 etc... however, this isn't then changing the host status section to critical. The warning and critical levels I have mirrored from check_ping, and they work fine (i.e. change the host status where necessary)

Has anybody else had this issue or at least know a desired check command which should work as intended for this purpose?

Re: check_icmp not changing host status

Posted: Tue Jun 21, 2016 10:09 am
by rkennedy
Can you show us the full check command you're using, so that we can try to replicate this issue? I don't believe it should be behaving like this.

Re: check_icmp not changing host status

Posted: Thu Jun 23, 2016 7:14 am
by jmill17
$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -n 5 | egrep -v 'run as root|^To |chmod u\+s'

checkcommand from NConf as using as the configuration tool.

Arguments set in advanced tabs, replicated mostly from check_ping's levels.

Re: check_icmp not changing host status

Posted: Thu Jun 23, 2016 9:57 am
by rkennedy
Can you also post your $ARG$ variables? We need all of the information.

Also, what version of check_icmp are you running? ./check_icmp -V

Re: check_icmp not changing host status

Posted: Fri Jun 24, 2016 5:59 am
by jmill17
Version 2.1.1

300.0,80% - w
500.0,100% -c

Re: check_icmp not changing host status

Posted: Fri Jun 24, 2016 11:25 am
by tgriep
When a check is run on a Nagios server, it returns a code if the Status is OK = 0, Warning = 1, Critical = 2, Unknown = 3.
Take a look at this link for more details.
https://nagios-plugins.org/doc/guidelines.html#AEN78
The problem is in your command definition, you are piping the output of the check to egrep, etc which is hiding the critical status of the plugin, it always returns 0 which is the OK state.
If you define your command like below, it should fix it for you.

Code: Select all

$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -n 5

Re: check_icmp not changing host status

Posted: Mon Jun 27, 2016 2:53 am
by jmill17
I did have that originally however receive this...

Warning: This plugin must be either run as root or setuid root.
To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
chmod u+s yourpluginfile
OK - 10.X.X.X: rta 0.632ms, lost 0%


However I have noticed it does still work, in terms of shows as ok, and the down hosts show as critical with the red background as hoped...

Re: check_icmp not changing host status

Posted: Mon Jun 27, 2016 10:07 am
by tgriep
That warning can can be resolved by setting up the owner / permissions for that plugin.
Login as root to the XI server and run the following commands. First change to the folder where the plugin is located on the drive.

Code: Select all

chown root.nagios check_icmp
chmod u+s check_icmp
Let us know if you still have problems after doing this.

Re: check_icmp not changing host status

Posted: Wed Jun 29, 2016 2:21 am
by jmill17
ah, I had the wrong owner assigned for some reason.

Thank you for your help, superb.

Re: check_icmp not changing host status

Posted: Wed Jun 29, 2016 9:28 am
by mcapra
Is it alright if we lock this thread and mark the issue as resolved?