I need to checking IP:PORT by ping, so I find out check_hping plugin to nagios. I'm trying to add it to the nagios core 4.


In the nagios service web interface I got the error :

CRITICAL: Error pinging

1, it seems that I have correctly added plugin to the plugin folder (permissions, ownership..)

root@onedata-desktop:~# ls -l  /usr/local/nagios/libexec/check_hping 
-rwxr-xr-x 1 nagios nagios 1994 Jul 26 17:36 /usr/local/nagios/libexec/check_hping

2, All arguments in command are correct:

define command{
        command_name    check-ping-on-port
        command_line    $USER1$/check_hping $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
define service{
        use                     generic-service
        host_name               cam_chodba
        service_description     Kamery
        check_command           check-ping-on-port!100!300!10201
        normal_check_interval   1
        retry_check_interval    1

3, nagios user's permissions:

root@onedata-desktop:~# cat /etc/group | grep nagios

4, The command is executable from command line:

onedata@onedata-desktop:~$ /usr/local/nagios/libexec/check_hping 200 300 1201
[sudo] password for onedata: 
OK: Average response time 20 ms; packet loss 0%

Maybe you can help me.

Thank you


First of all, I'm sorry my bad english.

The problem is that check_hping requires sudo for its use.

To remedy this, I used the following steps:

-You need to remove sudo from a line in the script(look for PRE variable setting).

-Change the command to the following:

define command{
        command_name    check-ping-on-port
        command_line    sudo $USER1$/check_hping $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$

-Add nagios on sudoers file to use this script without password.

Hope this solution works for you too.

Best regards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.