Nagios监控--Linux客户端(Use NRPE)
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-03-30
/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.d/rc.local netstat -atulnp | grep ''nrpe'' tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 3308/nrpe /usr/local/nagios/libexec/check_nrpe -H localhost NRPE v2.12 5)nrpe常见故障 错误一:/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 CHECK_NRPE: Error - Could not complete SSL handshake 解析办法:配置allowed_hosts=192.168.1.2,127.0.0.1,然后kill进程再重启就OK了 错误二:/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 Connection refused by host 解析办法:Nrpe进程没有启动 四、配置监控服务器(Nagios服务器) 1、安装所需的软件(nagios、nagios-plugins、nrpe) wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz 2、安装nagios与nagios-plugins 1)nagios与nagios-plugins的安装 查看nagios服务端安装文档 2)安装nrpe tar -zxvf nrpe-2.12.tar.gz && cd nrpe-2.12 ./configure --enable-ssl --with-ssl-lib (前提是已经安装了openssl与openssl-devel) make all && make install-plugin && make install-daemon && make install-daemon-config 3)配置nrpe #在commands.cfg中定义nrpe这个外部构件 vi /usr/local/nagios/etc/nagios.cfg,打开下面这一行 cfg_file=/usr/local/nagios/etc/objects/commands.cfg vi /usr/local/nagios/etc/objects/commands.cfg,增加如下一行 #check nrpe define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } #配置要监控的linux主机 vi /usr/local/nagios/etc/nagios.cfg,加入如下一行 cfg_file=/usr/local/nagios/etc/objects/mylinux.cfg touch /usr/local/nagios/etc/objects/mylinux.cfg,增加如下内容 define host{ use linux-server host_name mylinux alias mylinux address 192.168.1.43 } define service{ use generic-service #使用的是/usr/local/nagios /etc/objects/templates.cfg中所定义的 host_name mylinux service_description Swap Usage check_command check_nrpe!check_swap } define service{ use generic-service host_name mylinux service_description Current Load check_command check_nrpe!check_load } define service{ use generic-service host_name mylinux service_description Partition Usage check_command check_nrpe!check_disk } define service{ use generic-service host_name mylinux service_description Current Users check_command check_nrpe!check_users } define service{ use generic-service host_name mylinux service_description Total Processes check_command check_nrpe!check_total_procs } define service{ use generic-service host_name mylinux service_description PING check_command check_nrpe!check_ping |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: 看linux书籍做的一些重要笔记(2011.07.03更新)下一篇: liunx防火墙知识
关于Nagios监控--Linux客户端(Use NRPE)的所有评论