nagios_kehu.sh

####yum install##
yum install gcc gcc-c++ openssl* ntp perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker -y
echo ‘export LC_ALL=C‘>> /etc/profile
tail -1 /etc/profile
source /etc/profile
/usr/sbin/ntpdate pool.ntp.org

####install nagios###
/usr/sbin/adduser nagios -M -s /sbin/nologin
tar zxf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-perl-modules
make && make install
ls /usr/local/nagios/libexec/|wc -l
cd ..

####install nrpe####
tar zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config  
cd ..

#####install Params####
tar zxvf Params-Validate-0.91.tar.gz
cd Params-Validate-0.91
perl Makefile.PL
make 
make install
cd ..
####install Class######
tar zxvf Class-Accessor-0.31.tar.gz
cd Class-Accessor-0.31
perl Makefile.PL
make 
make install
cd ..
#####install Config#####
tar zxvf Config-Tiny-2.12.tar.gz
cd Config-Tiny-2.12
perl Makefile.PL
make 
make install
cd ..
####install Math-Calc#####
tar zxvf Math-Calc-Units-1.07.tar.gz
cd Math-Calc-Units-1.07
perl Makefile.PL
make 
make install
cd ..
#####install Regexp#####
tar zxvf Regexp-Common-2010010201.tar.gz
cd Regexp-Common-2010010201
perl Makefile.PL
make 
make install
cd ..
####install Nagios-Plugin###
tar zxvf Nagios-Plugin-0.34.tar.gz
cd Nagios-Plugin-0.34
perl Makefile.PL
make 
make install
cd ..

#for monitor iostat
yum install sysstat -y

cp -rf check_iostat /usr/local/nagios/libexec/
cp -rf check_memory.pl /usr/local/nagios/libexec/
dos2unix /usr/local/nagios/libexec/check_iostat
dos2unix /usr/local/nagios/libexec/check_memory.pl
chmod 755 /usr/local/nagios/libexec/check_iostat
chmod 755 /usr/local/nagios/libexec/check_memory.pl

nagios_kehu.sh

时间: 2024-10-06 16:40:19

nagios_kehu.sh的相关文章

23.dubbo脚本之stop.sh

#!/bin/bash cd `dirname $0` BIN_DIR=`pwd` cd .. DEPLOY_DIR=`pwd` CONF_DIR=$DEPLOY_DIR/conf SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'` if [ -z "$SERVER_NAME" ]; then     SERVER_NAME=`hostname` fi PID

24.dubbo脚本之server.sh

#!/bin/bash cd `dirname $0` if [ "$1" = "start" ]; then ./start.sh else if [ "$1" = "stop" ]; then ./stop.sh else if [ "$1" = "debug" ]; then ./start.sh debug else if [ "$1" = "res

25.dubbo脚本之restart.sh

#!/bin/bash cd `dirname $0` ./stop.sh ./start.sh

Oracle 11g RAC 二节点root.sh执行报错故障一例

OEL6.X IBM v3500存储多路径配置   http://koumm.blog.51cto.com/703525/1439760 2. 采用RHEL6.5 multipath多路径软件安装采用ASMLIB方式配置ASM共享磁盘成功,但是在第二节点执 行root.sh报如下错误提示,解决方式见3. Disk Group CRS creation failed with the following message:   ORA-15018: diskgroup cannot be creat

当root.sh与ORA-15031相遇

近日处理一个Oracle Grid infrastructure(GI)安装的问题,在执行root.sh过程中失败,并显示下面错误: Disk Group OCR creation failed with the following message: ORA-15018: diskgroup cannot be created ORA-15031: disk specification '/dev/vx/rdsk/dg_db01/lv_vote1' matches no disks    <<

debian和ubuntu的sh dash bash

Ubuntu和debian 的 shell 默认安装的是 dash,而不是 bash.运行以下命令查看 sh 的详细信息,确认 shell 对应的程序是哪个:$ls -al /bin/sh dash 比 bash 更轻,更快.但 bash 却更常用.如果一些命令.脚本等总不能正常执行,有可能是 dash 的原因.比如编译 Android 源代码的时候,如果使用 dash,则有可能编译出错,或者编译的系统不能启动. 通过以下方式可以使 shell 切换回 bash:$sudo dpkg-recon

使用sh库执行shell命令

python中执行shell命令 之前执行shell命令多是通过os.system(shell命令)的方式来执行,比较麻烦. 了解到sh是一个比subprocess好的库,能够执行shell命令 1.查看ip: [[email protected] myblog]# ifconfigeth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 172.31.253.193 netmask 255.255.240.0 broadcas

sh, 批量执行Linux命令

step 1:创建一个sh批处理命令文件 # vim /etc/batch_ssh/install_redis.sh step 2:给当前用户,能够执行sh脚本权限# chmod install_redis.sh 777 step 3: 编写要批量执行的命令,read表示等待前端用户输入,sleep表示等待时间单位为 秒. echo '\n begin to install 01 plugin \n'; yum install cpp -y; echo '\n yum finish instal

linux执行sh报错:$’\r’: 未找到命令的解决

背景 执行.sh脚本时出现$'\r': 未找到命令, 原因 是因为命令直接从windows 复制过来导致的 解决 yum install dos2unix dos2unix **.sh 进行转换 再次执行即可