为了避免目标端nrpe进程监控多个接口而造成的安全漏洞。有必要固定服务端的地址,对nrpe.cfg配置中,有下列一行介绍
#SERVER ADDRESS
# Address that nrpe should bind to in case there are more than one interface
# and you do not want nrpe to bind on all interfaces.
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd
#server_address=127.0.0.1
为了这个问题,有必要将这个地址改为服务器的ip地址。未修改前,监听情况。0.0.0.0表示监听所有的interfaces。
[root@hadoop-master etc]# netstat -plnt | grep nrpe
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 20222/nrpe 修改以后(需要重启nrpe服务),监听情况:
[root@hadoop-master etc]# netstat -plnt | grep nrpe
tcp 0 0 192.168.177.174:5666 0.0.0.0:* LISTEN 25996/nrpe