centos在被监控端安装nrpe
上一篇介绍了centos安装nagios服务端,现在我们要在被监控的服务器上安装nagios-plugins和nrpe,来保证nagios服务端可以监控所有的服务器.
系统:centos 5.8
需要的软件包:nagios-plugins-1.4.15.tar.gz nrpe-2.12.tar.gz
1.安装nrpe依赖包
yum -y install gcc glibc glibc-common openssl openssl-devel
2.安装nagios-plugin
useradd nagios
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download
tar zxf nagios-plugins-1.4.15.tar.gz && cd nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
chown -R nagios.nagios /usr/local/nagios
3.安装nrpe
wget http://nchc.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz
tar zxf nrpe-2.12.tar.gz && cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
sed -i 's/allowed_hosts=127.0.0.1/allowed_hosts=192.168.10.100/g' /usr/local/nagios/etc/nrpe.cfg
ps:授权nagios服务端有权访问nrpe主机,在allowed_hosts处填写nagios服务端的ip,设置多个IP用,(逗号)隔开 1.1.1.1,1.1.1.2
4.启动nrpe并设置开机自启动
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.d/rc.local
5.测试
在nagios服务端检测nrpe和服务端的连接状态
/usr/local/nagios/libexec/check_nrpe -H 192.168.10.101
运行正常的话将返回nrpe的版本号
如果无法访问的话,让防火墙放过5666端口.nrpe就安装完成了.
系统:centos 5.8
需要的软件包:nagios-plugins-1.4.15.tar.gz nrpe-2.12.tar.gz
1.安装nrpe依赖包
yum -y install gcc glibc glibc-common openssl openssl-devel
2.安装nagios-plugin
useradd nagios
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download
tar zxf nagios-plugins-1.4.15.tar.gz && cd nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
chown -R nagios.nagios /usr/local/nagios
3.安装nrpe
wget http://nchc.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz
tar zxf nrpe-2.12.tar.gz && cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
sed -i 's/allowed_hosts=127.0.0.1/allowed_hosts=192.168.10.100/g' /usr/local/nagios/etc/nrpe.cfg
ps:授权nagios服务端有权访问nrpe主机,在allowed_hosts处填写nagios服务端的ip,设置多个IP用,(逗号)隔开 1.1.1.1,1.1.1.2
4.启动nrpe并设置开机自启动
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.d/rc.local
5.测试
在nagios服务端检测nrpe和服务端的连接状态
/usr/local/nagios/libexec/check_nrpe -H 192.168.10.101
运行正常的话将返回nrpe的版本号
如果无法访问的话,让防火墙放过5666端口.nrpe就安装完成了.
评论: