Page 1 of 1

Error for ICMP Plugin

Posted: Wed Jul 22, 2020 11:30 am
by rajesh_kohmu
Hello Guys,

While creating host services there was error for host which says it is down. But all services were up and running and on Nagios XI console it was 'OK' State(Which is green)

out of curious i tried to check the script which is checking for ICMP ping and it had root permissions. Changed it to apache:nagios and it throwed me an error. Rolled back the changes to root:nagios. But now it is still showing as below error:


To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
chmod u+s yourpluginfile
check_icmp: Failed to obtain ICMP socket: Operation not permitted


Can someone please help on the above error?

Thanks,

Re: Error for ICMP Plugin

Posted: Wed Jul 22, 2020 12:00 pm
by scottwilkerson
check_icmp need root suid permissions

Code: Select all

-rwsrwxr-x 1 root nagios 159216 Jun  2 09:07 /usr/local/nagios/libexec/check_icmp
You likely need to run

Code: Select all

chmod u+s /usr/local/nagios/libexec/check_icmp

Re: Error for ICMP Plugin

Posted: Wed Jul 22, 2020 12:32 pm
by rajesh_kohmu
Thanks Scott,

yes, I made changes to the file with u+s and it worked for few hosts but for few it is "(No output on stdout) stderr:"

Any idea?

Re: Error for ICMP Plugin

Posted: Wed Jul 22, 2020 12:39 pm
by rajesh_kohmu
now it is:

rta nan, lost 100% :(

Re: Error for ICMP Plugin

Posted: Wed Jul 22, 2020 12:52 pm
by scottwilkerson
Are you sure you can ping these same host addresses from the CLI?

Code: Select all

ping x.x.x.x
Because if you cannot, it could be a firewall issue between your Nagios server and the host blocking ICMP requests

Re: Error for ICMP Plugin

Posted: Wed Jul 22, 2020 12:54 pm
by rajesh_kohmu
Solved it. It was firewall issue. Thanks much for quick response.

Re: Error for ICMP Plugin

Posted: Wed Jul 22, 2020 12:55 pm
by scottwilkerson
rajesh_kohmu wrote:Solved it. It was firewall issue. Thanks much for quick response.
Great!

Locking thread