Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unix 向nagios添加插件_Unix_Nagios - Fatal编程技术网

Unix 向nagios添加插件

Unix 向nagios添加插件,unix,nagios,Unix,Nagios,我需要通过ping检查IP:PORT,所以我找到了到nagios的check_hping插件。我想把它加入nagios http://exchange.nagios.org/directory/Plugins/Network-Protocols/ICMP/chech_hping/details 在nagios服务web界面中,我得到了错误: CRITICAL: Error pinging 1,看来我已经正确地将插件添加到插件文件夹中了权限、所有权 root@onedata-desktop:~

我需要通过ping检查IP:PORT,所以我找到了到nagios的check_hping插件。我想把它加入nagios

http://exchange.nagios.org/directory/Plugins/Network-Protocols/ICMP/chech_hping/details
在nagios服务web界面中,我得到了错误:

CRITICAL: Error pinging
1,看来我已经正确地将插件添加到插件文件夹中了权限、所有权

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、命令中的所有参数均正确:

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用户权限:

root@onedata-desktop:~# cat /etc/group | grep nagios
nagios:x:1001:nagios,www-data
4、该命令可从命令行执行:

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%
也许你能帮我


谢谢

您在命令行中检查了tcp端口1201,并且在配置文件中有10201。你应该再次检查你的服务记录