【问题标题】:CHECK_NRPE Could not connect to....: Connect reset by peer in Nagios NRPECHECK_NRPE 无法连接到....:连接由 Nagios NRPE 中的对等方重置
【发布时间】:2016-08-26 11:43:10
【问题描述】:

我正在开发 opensuse Leap 42.1。我已经在远程主机上安装了 NRPE。我完全按照安装指南进行操作。但是,守护进程运行:

netstat -at | egrep "nrpe|5666"
tcp        0      0 *:nrpe                  *:*                     LISTEN      
tcp        0      0 *:nrpe                  *:*                     LISTEN 

但是执行 CHECK_NRPE 给我以下错误:

/usr/local/nagios/lib/check_nrpe -H localhost
CHECK_NRPE: Error - Could not connect to ::e298:8aF0:2cdf:0: Connection reset by peer

我看不出这里有什么问题。我尝试了几次安装。防火墙已关闭,但这不应该是问题。没有在其他地方发现错误。我错过了什么? 谢谢

【问题讨论】:

  • 它是否适用于本地主机的 IP 地址(127.0.0.1)?您的 /etc/hosts 文件中是否有“localhost”的条目?
  • 嗨。谢谢。它适用于 127.0.0.1,我也有一个 localhost 127.0.0.1 localhost 的条目
  • 您可能希望禁用 IPv6 支持,除非您的整个网络确实支持它。

标签: nagios nrpe


【解决方案1】:

我遇到了同样的问题。

只是,看看文件:/etc/xinetd.d/nrpe

现在,找到(几乎是开始)写着

的那一行

“禁用=是”

只需将其更改为“否”,然后:

# systemctl restart xinetd.service

# systemctl restart nrpe# service nrpe restart(如果不是 systemd)

使用最新的 nrpe 安装指南在 debian 8 上进行测试。

希望对你有帮助!

PS:不要忘记指令。

"only_from = (...)"

编辑:

在 debian 8 上的最后一次 NRPE 安装中,您必须:

编辑:/usr/local/nagios/etc/nrpe.cfg

第 98 行:allowed_hosts=x.x.x.x

在 /etc/xinetd.d/nrpe 中让指令“disable”进入“yes”。 (默认)

nrpe 服务似乎在 /usr/local/nagios/etc/nrpe.cfg 而不是 /etc/xinetd.d/nrpe 中查看允许的主机。

因为在 /etc/xinetd.d/nrpe 中有这一行:

 server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd

现在,是的:

# systemctl restart nrpe.service && systemctl restart xinetd.service

【讨论】:

  • 谢谢。我会调查的
  • "disable = yes" 和 "only_from = (...)" 是罪魁祸首,谢谢!
  • 在我的情况下(使用 xinetd),问题是 only_from = 127.0.0.1 -- 当我更改为 only_from = localhost 时,一切都很好。
【解决方案2】:

在我的情况下,问题只是我需要停止 nrpe 进程并重新开始

ps aux | grep nrpe

kill xxxx


run nrpe service

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-05
    • 2017-02-04
    • 2015-03-08
    • 2011-12-30
    相关资源
    最近更新 更多