码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu和Redhat安装nrpe

时间:2018-03-13 13:56:32      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:nrpe

客户端安装nrpe插件:

Ubuntu:

useradd -s /sbin/nologin -M nagios

apt-get install nagios-nrpe-server nagios-plugins

编辑nrpe配置文件

vi /etc/nagios/nrpe.cfg

allowed_hosts=127.0.0.1,10.0.0.2?? (默认为allowed_hosts=127.0.0.1)dont_blame_nrpe=1
:wq

启动nrpe

service nagios-nrpe-server start??

Redhat:?

rpm -i perl-Crypt-DES perl-NET-SNMP fping perl-Digest-SHA1 perl-Digest-HMACperl-Socket6? (需要下载,有的本地yum里有)

rpm -i nagios-plugins-1.4.16-1.el6.rf.x86_64.rpm

rpm -i nagios-nrpe-2.14-1.el6.rf.x86_64.rpm? (需要下载)

vi /etc/nagios/nrpe.cfg ?(command都需加sudo)

?command[check_cpu]=sudo /usr/lib64/nagios/plugins/check_snmp_load.pl -H 127.0.0.1 -C ‘xxxxx‘ -w 80 -c 90 --perf
allowed_hosts=127.0.0.1,10.0.0.2?? (默认为allowed_hosts=127.0.0.1)
dont_blame_nrpe=1
:wq

启动nrpe

service nrpe start

vi /etc/sudoers (此处不配会报NRPE: Unable to read output)

nagios ALL=(ALL) NOPASSWD:/usr/lib64/nagios/plugins/*

#Defaults ? ?requiretty
:wq
?记得开防火墙端口(199、5666,即snmp和nrpe)

vi /etc/sysconfig/iptables?

-A INPUT–p tcp –dport 199 –j ACCEPT
-A INPUT–p tcp –dport 5666 –j ACCEPT
:wq

service iptables restart

Ubuntu和Redhat安装nrpe

标签:nrpe

原文地址:http://blog.51cto.com/yangzhiming/2085968

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!