Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.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
Linux Nagios-拒绝连接&;套接字超时_Linux_Nagios - Fatal编程技术网

Linux Nagios-拒绝连接&;套接字超时

Linux Nagios-拒绝连接&;套接字超时,linux,nagios,Linux,Nagios,我需要监控windows服务(如CPU负载、内存使用等),所以我安装了Nagios监控工具。安装已完成,并且还安装了“check\n t”插件。 到目前为止,不存在任何错误,但在使用代理NSClient++执行脚本时,“主机拒绝连接”错误仍然存在 ./check_nt -H 10.112.32.78 -p 1248 -v MEMUSE -w 80 -c 90 Connection refused by host ./check_nt -H 10.112.32.78

我需要监控windows服务(如CPU负载、内存使用等),所以我安装了Nagios监控工具。安装已完成,并且还安装了“check\n t”插件。 到目前为止,不存在任何错误,但在使用代理NSClient++执行脚本时,“主机拒绝连接”错误仍然存在

./check_nt -H 10.112.32.78 -p 1248 -v MEMUSE -w 80 -c 90
              Connection refused by host

./check_nt -H 10.112.32.78 -p 1248 -v MEMUSE -w 80 -c 90
              Socket timeout after 10 seconds

我已验证nagios是否正常工作,如下所示

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
    Checked 8 services.
Checking hosts...
    Checked 1 hosts.
Checking host groups...
    Checked 1 host groups.
Checking service groups...
    Checked 0 service groups.
Checking contacts...
    Checked 1 contacts.
Checking contact groups...
    Checked 1 contact groups.
Checking service escalations...
    Checked 0 service escalations.
Checking service dependencies...
    Checked 0 service dependencies.
Checking host escalations...
    Checked 0 host escalations.
Checking host dependencies...
    Checked 0 host dependencies.
Checking commands...
    Checked 24 commands.
Checking time periods...
    Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

我是nagios新手,提前感谢:)

连接被防火墙阻止,或者您的nagios服务器不在“允许的主机”字段的nsc.ini文件中。确保windows防火墙上的端口以及Nagios服务器和客户端之间的任何其他网络过滤器都已打开

通过在Windows cmd中发出以下命令,确保要监视的Windows服务器/主机正在侦听端口5666上的NRPE和端口12489上的NT:

netstat -aon | findstr 5666
netstat -aon | findstr 12489
可能是Windows防火墙也在拒绝这些端口上的连接,请看一看

还可以将Nagios监控服务器的ip地址添加到NSClient++配置文件允许的\u主机中,该文件位于以下位置:

C:\Program Files\NSClient++
此外,在安装NSClient++的过程中,有一个复选框用于复选,请确保在安装过程中也选中了该复选框

从NSClient++编辑配置文件后,请确保重新启动NSClient++服务。(在services.msc或Start>Programs>NSClient++>停止NSClient++然后Start>Programs>NSClient++>启动NSClient++)

根据您对linux的喜好,这些命令很容易在谷歌上搜索到

安装必要的nagios debian软件包

apt get安装nagios图像nagios nrpe插件nagios nrpe服务器nagios插件nagios插件基本nagios插件标准
nagios3 nagios3 cgi nagios3通用nagios3内核

我刚刚在centos 7上遇到了一个问题。经过几个小时的搜索并与同一网络上的其他服务器进行比较,我准备放弃

我比较了两者的nrpe.cfg,肯定有允许主机的IP,所有插件都是rsync'd,权限都是一样的。我遇到的一个问题是远程登录到nrpe端口5666

telnet工作服务器ip 5666 工作

telnet不工作\u服务器\u ip 5666 连接被拒绝

花了我一段时间,但不知怎的,我遇到了两个操作系统,一个是centos6,另一个是centos7

如果要在centos7上安装nrpe,请确保禁用防火墙,我不是在说SELinux

systemctl停止防火墙D


然后再试一次

如果您能提供一些有关正在运行的Windows版本和NSClient++设置的详细信息,那就太好了。通常,防火墙规则成为此类问题的主要原因,因此值得检查它们。是的,我知道防火墙并没有阻止这一点,但我如何获得设置,我对此一无所知。