#!/bin/bash
#!make in 小5 on 2013-05 at picc
###############QQ:1214854702###############################
#scp 10.132.40.13:/usr/local/src/nagios-plugins-1.4.15.tar.gz /usr/local/src/nrpe-2.14.tar.gz
useradd -s /sbin/nologin nagios
cd /usr/local/src/
tar zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --prefix=/usr/local/nagios
make && make install
chown -R nagios.nagios /usr/local/nagios
cd /usr/local/src/
tar zxvf nrpe-2.14.tar.gz
cd nrpe-2.14
./configure ; make all ; make install-plugin ; make install-daemon ; make install-daemon-config ;make install-xinetd
if [ "$?" == "0" ];then
echo "installed ok!"
else
exit 1
fi
sed -i 's/127.0.0.1/127.0.0.1 10.128.118.141/g' /etc/xinetd.d/nrpe
echo "nrpe 5666/tcp #nrpe" >> /etc/services
service xinetd restart
chkconfig --add xinetd
chkconfig xinetd on
echo "complete installed !"
转载于:https://blog.51cto.com/wxlxiao5/1223583