Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1154372
  • 博文数量: 150
  • 博客积分: 2739
  • 博客等级: 少校
  • 技术积分: 2392
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-07 12:28
文章分类

全部博文(150)

文章存档

2015年(2)

2014年(16)

2013年(10)

2012年(58)

2011年(64)

分类: Python/Ruby

2014-04-27 22:34:06


nagios监控绘图之--nrpe一键安装

        Nrpe是用来nagios监控机器的一个插件,用来监控Linux、Windows是个很好、很常用的辅助插件,在工作之中,要监控机器大部分需要配置该插件,故此弄个安装脚本



点击(此处)折叠或打开

  1. #!/bin/bash
  2. #date 2013-05-09
  3. ##Auther Gavin
  4. ##Mail wkgbc456@163.com
  5. #blog http://wkgbc.blog.chinaunix.net/
  6. SOFT=nrpe-2.13
  7. NPATH=/usr/local/nagios

  8. rm -rf /tmp/install.log
  9. #####################User###############################
  10. if grep "nagios" /etc/passwd ;then
  11.     echo "The nagios has exist ....." >>/tmp/install.log;
  12. else
  13. groupadd nagios
  14. useradd nagios -g nagios
  15. fi

  16. ####################Install Nrpe########################
  17. rm -rf $SOFT
  18. if [ -f $SOFT.tar.gz ];then
  19.  tar xvf $SOFT.tar.gz
  20.  cd $SOFT
  21.  ./configure --prefix=$NPATH
  22. [ $? == "0" ] && make all || exit;
  23. [ $? == "0" ] && make install-plugin || exit;
  24. [ $? == "0" ] && make install-daemon || exit;
  25. [ $? == "0" ] && make install-daemon-config || exit;
  26. else
  27.   exit;
  28. fi

  29. echo "Install well...." >>/tmp/install.log
  30. cp -R -f nrpe.cfg $NPATH/etc/

  31. [ -f libexec.tar.gz ] &&tar xvf libexec.tar.gz && cp -R -f libexec/* $NPATH/libexec/

  32. [ $? == "0" ] && echo "The libexec files copy successfully...." >>/tmp/install.log

  33. chown nagios.nagios $NPATH/* -R

  34. #grep "nrpe.cfg" /etc/rc.local && echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg –d" >>/etc/rc.local || exit;
  35. if grep "nrpe.cfg" /etc/rc.local ;then
  36.      echo "The nrpe has exsits.....";
  37. else
  38.     echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >>/etc/rc.local;
  39. fi

  40. ###############start Nrpe..#################################
  41. echo "start Nrpe...."
  42. pkill nrpe
  43. /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d



其他一键安装脚本,测试环境Centos 5.5 

点击(此处)折叠或打开

  1. cacti与npc一键安装脚本链接:http://blog.chinaunix.net/uid-25046147-id-4228848.html

  2. nagios一键安装脚本:http://blog.chinaunix.net/uid-25046147-id-4228845.html

  3. nrpe一键安装:http://blog.chinaunix.net/uid-25046147-id-4228843.html

  4. pnp4nagios一键安装脚本:http://blog.chinaunix.net/uid-25046147-id-4228835.html

  5. 一键安装LAMP:http://blog.chinaunix.net/uid-25046147-id-4226114.html




阅读(3868) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~