Patrik18
Patrik18

Reputation: 329

adding plugin to nagios

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.

http://exchange.nagios.org/directory/Plugins/Network-Protocols/ICMP/chech_hping/details

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
nagios:x:1001:nagios,www-data

4, The command is executable from command line:

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

Maybe you can help me.

Thank you

Upvotes: 0

Views: 737

Answers (2)

Davide Madrisan
Davide Madrisan

Reputation: 2300

The script check_hping requires sudo. Have you configured the required rights in a sudo configuration file (/etc/sudoers or a modular file in /etc/sudoers.d/) for the nagios user? The label NOPASSWD will be required in order not to ask for a password.

Upvotes: 0

You check tcp port 1201 in command line and have 10201 in configuration file. You should check your service record once again.

Upvotes: 1

Related Questions