1.在监控机上安装NRPE
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
2.在被监控机上安装nagios插件和NRPE
(1).先增加nagios用户:
useradd nagios
(2.)安装nagios插件:
tar -zxvf nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.14
./configure --prefix=/usr/local/nagios
make
make install
(3).安装nrpe:
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure --prefix=/usr/local/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd nrpe安装为xinetd服务
(4).编辑nrpe配置文件,增加监控机地址:
#vi /etc/xinetd.d/nrpe
only_from = 192.168.18.100
(5).修改services文件,增加端口
#vi /etc/services
nrpe 5666/tcp #NRPE
(6).重启xinetd服务
service xinetd restart
(7).查看服务是否启动
#/usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12
如果出现Connection refused by host 需要安装yum intall openssl*
至此被监控机上的操作就结束了,如果有需要增加监控项,需修改/etc/xinetd.d/nrpe文件。