Chinaunix首页 | 论坛 | 博客
  • 博客访问: 384054
  • 博文数量: 114
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1219
  • 用 户 组: 普通用户
  • 注册时间: 2015-02-07 21:23
文章分类

全部博文(114)

文章存档

2018年(1)

2017年(5)

2016年(87)

2015年(21)

我的朋友

分类: 系统运维

2016-07-27 18:01:04


  1. #!/bin/sh
  2. ping www.baidu.com -c 3 &> /dev/null
  3. if [ $? -eq 0 ];then
  4.         echo "Your Internet is available and will be installed through the network dependent package."
  5.         sleep 5
  6.         yum clean all
  7.         yum -y install openssl openssl-devel gcc-c++
  8. else    
  9.     echo "Can not download through the Internet, please check the yum and DNS related configuration."
  10.     exit
  11. fi
  12. useradd -s /bin/false nagios
  13. tar zxvf nagios-plugins-1.4.16.tar.gz
  14. cd nagios-plugins-1.4.16
  15. ./configure
  16. make && make install
  17. NAG=/usr/local/nagios/
  18. chown nagios:nagios $NAG
  19. chown -R nagios:nagios $NAG/libexec/
  20. cd ..
  21. tar zxvf nrpe-2.13.tar.gz
  22. cd nrpe-2.13
  23. ./configure
  24. make all;make install-plugin;make install-daemon;make install-daemon-config
  25. sed -i 's@allowed_hosts=127.0.0.1@allowed_hosts=192.168.88.151@' $NAG/etc/nrpe.cfg
  26. /usr/local/nagios/bin/nrpe -c $NAG/etc/nrpe.cfg -d
  27. test=$(netstat -tuln | grep ":5666")
  28. if [ "$test" != "" ]; then
  29.         echo -e " \n nrpe is running in your system."
  30.         echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.local
  31. else
  32.         echo -e "\n NRPE Error"
  33.         exit 1
  34. fi
  35. if [ $? -eq 0 ];then
  36.         echo -e "\n tail -2 /etc/rc.d/rc.local"
  37.         echo "`tail -2 /etc/rc.d/rc.local`"
  38. fi

阅读(1139) | 评论(0) | 转发(0) |
0

上一篇: nagios监控mysql主从

下一篇:shell应用实例

给主人留下些什么吧!~~