1、通过日志排查问题:

位置:/usr/local/nagios/var/nagios.log
2、常见错误:

A、It appears as though you do not have permission to view information for any of the servies you requested

原因:打开IE登录的nagios用户无刚问权限

解决:vi cgi.cfg +119

authorized_for_system_information=admin

#把建立的用户添加到后边,注意用逗号隔开。


B、Return code of 127 is out of bounds - plugs may be missing

原因:可能因为缺少插件。在command.cfg里未定义或者定义了实际不存在的插件。

解决:检查服务端和客户端的/usr/local/nagios/libexec

检查 ll /usr/local/nagios/libexec/ 目录是否有services.cfg里使用的插件。


C、CHECK_NRPE:Errdr -Could not complete SSl handshake 错误。

原因:一般为客户端nrpe权限问题

解决: vi /usr/local/nagios/etc/nrpe.cfg +79

allowed_hosts=10.0.0.22,127.0.0.1

重启: pkill nrpe

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


D、Timeout while attempting connection |Connection refused or time out

原因:防火墙阻挡或者nrpe服务为开启

解决:/etc/init.d/iptables stop


E、Internal Server Error 错误

原因:selinux 导致

解决: vi /etc/selinux/config

修改SELINUX项为disabled


F、CRITICAL -Socket timeout after 31 secouds

原因:网络故障、服务器拒绝连接或防火墙问题


E、NRPE: Unable to read output

原因:被动模式客户端脚本没有执行权限:

解决: chmod 644 xx


F、NRPE :Command 'check_iostat' not defined

原因:插件未定义

解决:客户端,nrpe的命令名定义不正确,导致服务端check_nrpe无法获取争取的命令名

服务端,service.cfg 里的check_nrpe!check_iostt




提醒:

a、检查客户端系统自带的防火墙,是否把nrpe默认端口5666 drop掉

b、把nrpe log打开,可以发现更多有用的信息

c、nrpe 添加完命令,有没有真正的重启 !很重要。