check_icmp not changing host status

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
jmill17
Posts: 12
Joined: Fri Apr 15, 2016 9:24 am

check_icmp not changing host status

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_icmp not changing host status

Post 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.
Former Nagios Employee
jmill17
Posts: 12
Joined: Fri Apr 15, 2016 9:24 am

Re: check_icmp not changing host status

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_icmp not changing host status

Post 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
Former Nagios Employee
jmill17
Posts: 12
Joined: Fri Apr 15, 2016 9:24 am

Re: check_icmp not changing host status

Post by jmill17 »

Version 2.1.1

300.0,80% - w
500.0,100% -c
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_icmp not changing host status

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
jmill17
Posts: 12
Joined: Fri Apr 15, 2016 9:24 am

Re: check_icmp not changing host status

Post 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...
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_icmp not changing host status

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jmill17
Posts: 12
Joined: Fri Apr 15, 2016 9:24 am

Re: check_icmp not changing host status

Post by jmill17 »

ah, I had the wrong owner assigned for some reason.

Thank you for your help, superb.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_icmp not changing host status

Post by mcapra »

Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
Locked