网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

nagios_client_V1-sh

#!/bin/sh
function nagios(){
yum install gcc glibc glibc-common openssl-devel dos2unix -y
/usr/sbin/useradd -m nagios -s /sbin/nologin
cd /application/tools/
unzip oldboy_training_nagios_soft.zip
yum -y install perl-devel
tar zxf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --prefix=/application/nagios --enable-perl-modules --enable-redhat-pthread-workaround 
make && make install
cd ../
#ls /application/nagios/libexec/|wc -l
#----------------------------------------
cd /application/tools/
tar zxf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure  --prefix=/application/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
cd ..
#----------------------------------------
cd /application/tools/
tar zxvf Params-Validate-0.91.tar.gz 
cd Params-Validate-0.91 
perl Makefile.PL 
make  
make install 
cd .. 
#----------------------------------------
cd /application/tools/
tar zxvf Class-Accessor-0.31.tar.gz
cd Class-Accessor-0.31
perl Makefile.PL
make
make install
cd ..
#----------------------------------------
cd /application/tools/
tar zxvf Config-Tiny-2.12.tar.gz
cd Config-Tiny-2.12
perl Makefile.PL
make
make install
cd ..
#----------------------------------------
cd /application/tools/
tar zxvf Math-Calc-Units-1.07.tar.gz
cd Math-Calc-Units-1.07
perl Makefile.PL
make
make install
cd ..
#----------------------------------------
cd /application/tools/
tar zxvf Regexp-Common-2010010201.tar.gz
cd Regexp-Common-2010010201
perl Makefile.PL
make
make install
cd ..
#----------------------------------------
cd /application/tools/
tar zxvf Nagios-Plugin-0.34.tar.gz
cd Nagios-Plugin-0.34
perl Makefile.PL
make
make install
cd ..
#----------------------------------------
cd /application/tools/
yum install sysstat -y
/bin/cp /application/tools/check_memory.pl /application/nagios/libexec
/bin/cp /application/tools/check_iostat /application/nagios/libexec

chmod 755 /application/nagios/libexec/check_memory.pl
chmod 755 /application/nagios/libexec/check_iostat
dos2unix /application/nagios/libexec/check_iostat
dos2unix /application/nagios/libexec/check_memory.pl

#----------------------------------------
/bin/cp /application/nagios/etc/nrpe.cfg /application/nagios/etc/nrpe.cfg.ori
perl -pi -e 's/allowed_hosts=127.0.0.1/allowed_hosts=127.0.0.1,192.168.2.91/g' /application/nagios/etc/nrpe.cfg 
cp  /application/nagios/etc/nrpe.cfg  /application/nagios/etc/nrpe.cfg.ori
sed -i '199,203d'  /application/nagios/etc/nrpe.cfg
echo "command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,6 -c 30,25,20">>/application/nagios/etc/nrpe.cfg
echo "command[check_mem]=/usr/local/nagios/libexec/check_memory.pl -w 6% -c 3%">>/application/nagios/etc/nrpe.cfg
echo "command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 8% -p /">>/application/nagios/etc/nrpe.cfg
echo "command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%">>/application/nagios/etc/nrpe.cfg
echo "command[check_iostat]=/usr/local/nagios/libexec/check_iostat -w 6 -c 10">>/application/nagios/etc/nrpe.cfg
pkill nrpe 
sleep 2
/application/nagios/bin/nrpe -c /application/nagios/etc/nrpe.cfg -d
echo  "#nagios nrpe process cmd by liycwing 2014-12-25" >> /etc/rc.local
echo "/application/nagios/bin/nrpe -c /application/nagios/etc/nrpe.cfg -d">>/etc/rc.local
netstat -lnt|grep 5666 && echo "nagios client is ok"
}
nagios

网页名称:nagios_client_V1-sh
网页地址:http://bjjierui.cn/article/pgiphg.html

其他资讯