nrpe:网络服务器绑定失败(98:地址已在使用中)

时间:2016-05-11 15:22:47

标签: linux monitoring nrpe icinga

我在同一台计算机上安装了iCinganrpe。我使用nrpe监视许多linux机器,所以我也在本地安装了nrpe。

当我在本地启动我的nrep service nrpe start时,它会像/var/log/messages

一样播出错误
nrpe : Network server bind failure (98: Address already in use)

我有谷歌问题,并找到5666端口使用

[root@cosrh6-74 conf.d]# netstat -apn | grep :5666
tcp        0      0 127.0.0.1:50539           10.104.16.212:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:50608           10.104.16.212:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:41987           10.104.16.210:5666          TIME_WAIT   -
tcp        0      1 127.0.0.1:42001           10.104.16.210:5666          SYN_SENT    -
tcp        0      0 127.0.0.1:50576           10.104.16.212:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:41927           10.104.16.210:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:52598           10.3.81.172:5666            TIME_WAIT   -
tcp        0      0 127.0.0.1:52624           10.3.81.172:5666            TIME_WAIT   -
tcp        0      0 127.0.0.1:41962           10.104.16.210:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:41979           10.104.16.210:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:52566           10.3.81.172:5666            TIME_WAIT   -
tcp        0      0 127.0.0.1:41928           10.104.16.210:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:52569           10.3.81.172:5666            TIME_WAIT   -
tcp        0      0 127.0.0.1:41955           10.104.16.210:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:52587           10.3.81.172:5666            TIME_WAIT   -
tcp        0      0 127.0.0.1:50586           10.104.16.212:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:50547           10.104.16.212:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:52588           10.3.81.172:5666            TIME_WAIT   -
tcp        0      0 127.0.0.1:50609           10.104.16.212:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:50567           10.104.16.212:5666          TIME_WAIT   -
tcp        0      0 127.0.0.1:52592           10.3.81.172:5666            TIME_WAIT   -
tcp        0      0 :::5666                     :::*                        LISTEN      757/xinetd

我已将/etc/nagios/nrpe.cfg端口从 5666 更改为 56666

如何在 icinga2服务器中配置主机配置中的不同端口(不同主机的不同端口),以监控 nrpe 在不同端口运行的计算机?

这是改变港口的权利吗?或者其他任何方式来做到这一点?如果我做错了,请纠正我?

2 个答案:

答案 0 :(得分:1)

在每个主机定义中添加:

vars.nrpe_port = <host_nrpe_port>

参考:docs.icinga.org

答案 1 :(得分:0)

command.conf文件中添加了这样的端口,

object CheckCommand "check-nrpe" {
    import "plugin-check-command"
    command  = ["/usr/local/nagios/libexec/check_nrpe"]
     "-p" ="56666"
     "-H" ="$host$"
     "-c" = "$nrpe_command$"
     "-a" = $nrpe_arguments$"
}

“ - p”=“56666”适合我!!

修改: 或者我们可以从主机配置中传递相似的参数(在主机配置中保留端口号,如@ 7171u答案)。