您的位置:首页 > 移动开发 > IOS开发

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

2018-03-07 11:05 281 查看
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
状态正常

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息