nagios监控绘图之--nrpe一键安装
Nrpe是用来nagios监控机器的一个插件,用来监控Linux、Windows是个很好、很常用的辅助插件,在工作之中,要监控机器大部分需要配置该插件,故此弄个安装脚本
-
#!/bin/bash
-
#date 2013-05-09
-
##Auther Gavin
-
##Mail wkgbc456@163.com
-
#blog http://wkgbc.blog.chinaunix.net/
-
SOFT=nrpe-2.13
-
NPATH=/usr/local/nagios
-
-
rm -rf /tmp/install.log
-
#####################User###############################
-
if grep "nagios" /etc/passwd ;then
-
echo "The nagios has exist ....." >>/tmp/install.log;
-
else
-
groupadd nagios
-
useradd nagios -g nagios
-
fi
-
-
####################Install Nrpe########################
-
rm -rf $SOFT
-
if [ -f $SOFT.tar.gz ];then
-
tar xvf $SOFT.tar.gz
-
cd $SOFT
-
./configure --prefix=$NPATH
-
[ $? == "0" ] && make all || exit;
-
[ $? == "0" ] && make install-plugin || exit;
-
[ $? == "0" ] && make install-daemon || exit;
-
[ $? == "0" ] && make install-daemon-config || exit;
-
else
-
exit;
-
fi
-
-
echo "Install well...." >>/tmp/install.log
-
cp -R -f nrpe.cfg $NPATH/etc/
-
-
[ -f libexec.tar.gz ] &&tar xvf libexec.tar.gz && cp -R -f libexec/* $NPATH/libexec/
-
-
[ $? == "0" ] && echo "The libexec files copy successfully...." >>/tmp/install.log
-
-
chown nagios.nagios $NPATH/* -R
-
-
#grep "nrpe.cfg" /etc/rc.local && echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg –d" >>/etc/rc.local || exit;
-
if grep "nrpe.cfg" /etc/rc.local ;then
-
echo "The nrpe has exsits.....";
-
else
-
echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >>/etc/rc.local;
-
fi
-
-
###############start Nrpe..#################################
-
echo "start Nrpe...."
-
pkill nrpe
-
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
|
其他一键安装脚本,测试环境Centos 5.5
-
cacti与npc一键安装脚本链接:http://blog.chinaunix.net/uid-25046147-id-4228848.html
-
-
nagios一键安装脚本:http://blog.chinaunix.net/uid-25046147-id-4228845.html
-
-
nrpe一键安装:http://blog.chinaunix.net/uid-25046147-id-4228843.html
-
-
pnp4nagios一键安装脚本:http://blog.chinaunix.net/uid-25046147-id-4228835.html
-
-
一键安装LAMP:http://blog.chinaunix.net/uid-25046147-id-4226114.html
阅读(1509) | 评论(0) | 转发(0) |