[rhel6.5]配置nagios过程中的几个错误

  • 1.点击拓扑图,不会出现图形信息,这个错误是因为缺少gd-devel安装宝造成的;
    这里写图片描述
[root@server20 nagios-cn-3.2.3]# yum install /mnt/nagios/gd-devel-2.0.35-11.el6.x86_64.rpm -y
  • 使用命令检测httpd服务状态出现403的错误,这个是由于请求的页面不存在导致的
[root@server20 nagios]# ./libexec/check_http -H 172.25.23.20 -p 80
HTTP WARNING: HTTP/1.1 403 Forbidden - 4184 bytes in 0.000 second response time |time=0.000434s;;;0.000000 size=4184B;;;0
  • 需要创建默认的软件发布目录
[root@server20 nagios]# touch /var/www/html/index.html
[root@server20 nagios]# chown apache.apache /var/www/html/index.html
[root@server20 nagios]# ./libexec/check_http -H 172.25.23.20 -p 80
HTTP OK: HTTP/1.1 200 OK - 266 bytes in 0.001 second response time |time=0.000536s;;;0.000000 size=266B;;;0
  • 在配置好nagios之后启动服务httpd,nagios,使用浏览器访问,提示URL/nagios不存在
  • 大多数是因为apache用户没有访问nagios目录的权限
[root@server20 nagios]# id apache
uid=48(apache) gid=48(apache) groups=48(apache)
[root@server20 nagios]# usermod -G nagios apache
  • 这里还有一个没有结局的问题
[root@server20 nagios]# ./libexec/check_ping  -H 172.25.23.21 -w 100,20% -c 200,50% -p 5 
/bin/ping
CRITICAL - Could not interpret output from ping command
  • 提示无法解释来自ping命令的输出,check_ping命令是nagios-plugins插件提供的,在编译这个插件时的选项如下
(reverse-i-search)`./co': ./configure --with-nagios-user=nagios --enable-extra-opts --enable-libtap --enable-perl-modules --with-cgiurl --with-perl  --with-ping-command=/bin/ping   --with-trusted-path --with-nagios-group=nagios 
  • 网上提示说是因为没有指定--with-ping-command=/bin/ping,这个选项,在我指定了之后,并且重新进行编译安装之后,错误还是存在;
  • 还有一种说法是因为权限问题,执行
chmod u+s /bin/ping
  • 对于这个问题,反其道而行之,将编译的选项--with-ping-command=/bin/ping去掉,这里使用的软件是nagios-plugins-2.1.1.tar.gz
  • 这里给出我的编译选项
[root@server20 nagios-plugins-2.1.1]# ./configure --with-nagios-user=nagios --enable-extra-opts --enable-libtap --enable-perl-modules --with-cgiurl --with-perl   --with-trusted-path --with-nagios-group=nagios 
  • 问题就解决了
[root@server20 libexec]# ./check_ping  -H 172.25.23.21 -w 100,20% -c 200,50% -p 5 
PING OK - Packet loss = 0%, RTA = 0.31 ms|rta=0.310000ms;100.000000;200.000000;0.000000 pl=0%;20;50;0

这里写图片描述

  • 浏览器访问显示ping状态正常
    这里写图片描述
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值