重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
1.check_iftraffic监控网卡流量的配置及错误解决办法
成都创新互联专注为客户提供全方位的互联网综合服务,包含不限于做网站、成都网站建设、固阳网络推广、重庆小程序开发公司、固阳网络营销、固阳企业策划、固阳品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;成都创新互联为所有大学生创业者提供固阳建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com
服务端:
添加以下内容:
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设置正确的权限”
解决办法: