nagios监控linuxnrpe安装

1、下载nrpe2.15

泰宁ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:028-86922220(备注:SSL证书合作)期待与您的合作!

  wgethttp://cznic.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

2、yum install openssl openssl-devel

   cd nrpe-2.15

   ./configure --enable-ssl --with-nagios-user=nagios --with-nagios-group=nagcmd --with-nrpe-user=nagios --with-nrpe-group=nagcmd

   make all

   make install-plugin

   make install-daemon

   make install-daemon-config

   make install-xinetd

3、编辑nrpe配置文件,增加监控机地址:   

      vi /etc/xinetd.d/nrpe

      only_from = nagios-server-ip,127.0.0.1

4、编辑vi /usr/local/nagios/etc/nrpe.cfg

      allowed_hosts=nagios-server-ip,127.0.0.1

5、修改services文件,增加端口
          vi /etc/services
          nrpe            5666/tcp                        #NRPE

6、启动 nrpe

   /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

   设置开机启动

   vi /etc/rc.d/rc.local加入/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

   验证是否启动

   netstat -an |grep 5666  

   tcp        0      0 0.0.0.0:5666                0.0.0.0:*                   LISTEN    

7、报错

   1)NRPE: Command 'check_hda1' not defined

   解决方法:

   nagios主机与被监控linux同时修改:vi /usr/local/nagios/etc/nrpe.cfg

     将command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1

    修改为  command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1

    注意 sda1为需要监控的分区

   2)NRPE: Command 'check_swap' not defined

   解决方法:

   nagios主机与被监控linux同时修改:vi /usr/local/nagios/etc/nrpe.cfg

   增加command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%

8、参考内容http://chenxy.blog.51cto.com/729966/175893/


网站名称:nagios监控linuxnrpe安装
网站路径:http://myzitong.com/article/jjsphh.html