错误1、在nagios页面中,有个Map链接,一点开就报错:

The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server

--解决:

statusmap.cgi依赖gd开发包

通过yum安装gd开发包,然后重新编译configuration及make nagios cgi部分

yum -y install gd gd-devel

./configure --with-gd-lib=/usr/lib   --with-gd-inc=/usr/include  

#make all  

#make install  

#make install-init  

#make install-config  

#make install-commandmode

make  install-config



2】普通用户(除nagiosadmin外所有用户)点nagios页面中的service等链接,都出现如下错误:

It appears as though you do not have permission to view information for any of the hosts you requested...

If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI

and check the authorization options in your CGI configuration file.

---原因:

认证用户不正确,编辑etc/cgi.cfg,该文件里默认的是nagiosadmin,如果新建的用户要想查看的话,得添加进去,多用户用逗号分开

authorized_for_system_information=nagiosadmin

authorized_for_configuration_information=nagiosadmin

authorized_for_system_commands=nagiosadmin

authorized_for_all_services=nagiosadmin

authorized_for_all_hosts=nagiosadmin

authorized_for_all_service_commands=nagiosadmin

authorized_for_all_host_commands=nagiosadmin

如果不是 nagiosadmin 需要到后面添加,例子 authorized_for_system_information=nagiosadmin,admin


3】如果提示“Whoops!   Error: Could not read object configuration data! ”,这是因为没有启动nagios后台进程,执行以下命令

解决方法:/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg


4】The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server

The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server

确定libgd libgd-devellibpnglibpng-devellibjpeglibjpeg-develzlibzlib-devel 已经被安装

在回到nagios的解压目录,然后make distclean后继续源码安装

./configure --with-gd-lib=/usr/lib --with--gd-inc=/usr/include && make all && make install && make install-init&& make install-config && make install-commandmode && make install-config

最后重启nagios就可以看到了


5】无法通过web界面控制nagios的修改,如图,想要通过web启用该服务的报警,结果

212958160.jpg

/usr/local/nagios/var/rw,查看nagios.cmd的权限

prw-rw---- 1 nagios nagios 0 Aug 12 21:27 nagios.cmd

加一个写的权限,chmod o+w nagios.cmd然后就ok了