0

我已经安装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

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

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

这是更改端口的权利吗?或任何其他方式来做到这一点?如果我做错了什么请纠正我?

4

2 回答 2

1

在每个主机定义中添加:

vars.nrpe_port = <host_nrpe_port>

参考:docs.icinga.org

于 2016-05-12T09:49:12.673 回答
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 答案)。

于 2016-06-14T09:45:31.860 回答