agios监控配置错误汇总
1.check_iftraffic监控网卡流量的配置及错误解决办法
服务端:
添加以下内容:
vim /usr/local/nagios/etc/objects/commands.cfg
#check iftraffic
define command{
command_name check_iftraffic
command_line $USER1$/check_iftraffic -H $HOSTADDRESS$ -i $ARG1$ -w $ARG2$ -c $ARG3$ -b $ARG4$ -u $ARG5$
}
vim /usr/local/nagios/etc/objects/62xxx.cfg
define service{
use local-service
host_name 62xxx
service_description 网卡流量
check_command check_nrpe!check_iftraffic!"eth0"!50!100!100!m
notifications_enabled 0
}
监控客户端:
vim /usr/local/nagios/etc/nrpe.cfg
command[check_iftraffic]=/usr/local/nagios/libexec/check_iftraffic_nrpe.pl -i eth0 -w 50 -c 100 -b 100 -u m
重启服务后,nagios监控页面提示UNKNOWN,NRPE: Unable to read output
解决办法:在监控客户端执行 /usr/local/nagios/libexec/check_iftraffic_nrpe.pl -i eth0 -w 50 -c 100 -b 100 -u m
然后会在 /tmp 下面 生成一个文件 ls /tmp/ traffic_ifeth0 修改traffic_ifeth0的所属权限 chown nagios.nagios /tmp/traffic_ifeth0 -R
这样问题就OK了!
2.nagios错误日志里面 tailf /var/log/message提示
Aug 14 12:38:07 tsts-57 nagios: Warning: The check of service '交换空间利用率' on host 'localhost' looks like it was orphaned (results never came back). I'm scheduling an immediate check of the service...
Aug 14 12:38:07 tsts-57 nagios: Warning: The check of service '系统负荷' on host 'localhost' looks like it was orphaned (results never came back). I'm scheduling an immediate check of the service...
Aug 14 12:38:18 tsts-57 nagios: Warning: The check of service 'PING' on host '69nginx' looks like it was orphaned (results never came back). I'm scheduling an immediate check of the service...
。。。。。。等等吧
这个错误是因为nagios多进程引起的,你可以ps -ef | grep nagios 发现有多个进程,把他们全部杀掉,然后重启 /etc/init.d/nagios start ,问题就OK了!
nagios启用通知提示错误:“ 无法打开要更新的命令文件,外部命令文件或目录权限不对,参考FAQ设置正确的权限”
解决办法: