3

我需要监控 Windows 服务(如 CPU 负载、内存使用等),所以我安装了 Nagios 监控工具。安装完成并安装了“check_nt”插件。到目前为止,没有错误,但是在使用代理 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

M nagios 新手,在此先感谢 :)

4

4 回答 4

5

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

于 2012-08-23T18:17:24.840 回答
0

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

netstat -aon | findstr 5666
netstat -aon | findstr 12489

可能是 Windows 防火墙也拒绝了这些端口上的连接,请看一下。

还将 Nagios 监控服务器的 IP 地址添加到位于此处的 NSClient++ 配置文件的 allowed_hosts 中:

C:\Program Files\NSClient++

此外,在安装 NSClient++ 期间,还有一个 check_nt 复选框,请确保在安装期间也检查了该复选框。

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

于 2013-04-30T13:18:59.540 回答
0

http://pc-freak.net/blog/monitoring-windows-hosts-with-nagios-on-debian-gnulinux/

根据您的 linux 风格,这些命令很容易在 Google 上搜索到。

安装必要的 nagios debian 软件包

apt-get install nagios-images nagios-nrpe-plugin nagios-nrpe-server nagios-plugins nagios-plugins-basic nagios-plugins-standard nagios3 nagios3-cgi nagios3-common nagios3-core

于 2013-05-23T18:24:39.317 回答
0

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

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

telnet working_server_ip 5666 有效

telnet not_working_server_ip 5666 连接被拒绝。

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

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

systemctl 停止防火墙

然后再试一次

于 2016-05-11T16:21:36.023 回答