( 安装到 被监控的机器上)
新增用户和组
useradd nagios
groupadd nagcmd
(如果安装中报没有c编译器,就 yum install gcc)
下载nagios插件
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz
tar xzvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure
make
make install
安装 nagios_nrpe_2.9
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.9/nrpe-2.9.tar.gz
tar xzvf nrpe-2.9.tar.gz
cd nrpe-2.9
./configure --with-command-group=nagcmd --prefix=/usr/local/nagios
(如果报缺少ssl,请安装 yum install openssl-devel)
make all
make install-plugin
make install-daemon
make install-daemon-config
设置服务器地址
vi /usr/local/nagios/etc/nrpe.cfg
找到 allowed_hosts=127.0.0.1
后面加nagios服务器的IP, 用“,”隔开,加了之后如下:
allowed_hosts=127.0.0.1,192.168.8.208