在nagios服务器端执行以下命令报错:
[root@nagios libexec]# ./check_nrpe -H localhost
NRPE v2.12NRPE v2.12
其中192.168.1.18是本地ip,192.168.1.52是被监控端ip,被监控端执行命令结果如下:
# ./check_nrpe -H 192.168.1.52
NRPE v2.12
客户端nrpe.cfg配置为:
# ALLOWED HOST ADDRESSES
# This is an optional comma-delimited list of IP address or hostnames
# that are allowed to talk to the NRPE daemon.
#
# Note: The daemon only does rudimentary checking of the client's IP
# address. I would highly recommend adding entries in your /etc/hosts.allow
# file to allow only the specified host to connect to the port
# you are running this daemon on.
#
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd
allowed_hosts=192.168.1.18,127.0.0.1
# 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=192.168.1.52
需要在被监控机上添加nagios主机的访问权限:
vim/usr/local/nagios/etc/nrpe.cf
allowed_hosts=127.0.0.1,172.16.16.150vim/etc/xinetd.d/nrpe
only_from=127.0.0.1172.16.16.150版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。