nagios服务器问题1
我当时遇到奇怪现象,可以看到首页,链接打不开,检查apache配置,文件权限,后来确认当有部分程序出现奇怪状态,比如权限问题得时候,请关闭SELINUX
解决方法:
vi /etc/sysconfig/selinux 
SELINUX=enforcing --> SELINUX=disabled 
存盘退出


nagios服务器问题2
监控页面出现
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.
 1、修改/etc/cgi.cfg
vi    /usr/local/nagios/cgi.cfg 
 use_authentication=1 #把1修改为0,保存 
root@nagios#/etc/init.d/nagios restart



nagios服务器问题3
Warning: Return code of 127 for check of service 'Uptime' on host 'winserver' was out of bounds. Make sure the plugin you're trying to run actually exists
通常都的plugin没有安装,或者安装位置有问题,我遇到是查看目录:/usr/local/nagios/libexec/libexec、后来将libexec文件往前挪一下就可以了:/usr/local/nagios/libexec.
===================================
===================================
常见错误:
问题1:
It appears as though you do not have permission to view information for any of the hosts you requested

临时解决:
sed -i 's/use_authentication=1/use_authentication=0/g' /usr/local/nagios/etc/cgi.cfg
(取消了认证 可以浏览主机状态 但是无法在 nagios web 执行外部命令 )

解决:
登陆 nagios web接口的用户
需要和 /usr/local/nagios/etc/cgi.cfg 里面配置的用户匹配
没有可以手动添加 用逗号隔开


问题2:

Sorry Dave, I can't let you do that...

It seems that you have chosen to not use the authentication functionality of the CGIs.

I don't want to be personally responsible for what may happen as a result of allowing unauthorized users to issue commands to Nagios,so you'll have to disable this safeguard if you are really stubborn and want to invite trouble.

Read the section on CGI authentication in the HTML documentation to learn how you can enable authentication and why you should want to.

原因 : 未开启认证 开启认证可解决问题

编辑文件 /usr/local/nagios/etc/cgi.cfg
use_authentication 值设成1 (0/1 关闭/开启)
use_authentication=1
并重启 nagios
service nagios restart



问题3:

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.



原因 : 认证用户不正确

开启认证 认证的用户必须是 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

问题4:
调用外部命令错误 可能权限不够

解决:

临时解决:
chown -R nagios.nagcmd /usr/local/nagios/var/rw
chmod -R 777 /usr/local/nagios/var/rw

为什么说临时解决 ? 因为重启nagios 权限会还原 还是没权限执行

解决:
在安装 nagios 就要把用户选对 然后再安装
./configure --with-group=nagios --with-user=nagios --with-command-group=nagcmd --with-gd-lib=/usr/lib --with-gd-inc=/usr/include
make all
make install
make install-init
make install-config
make install-commandmode

===

rw\nagios.cmd 权限是 nagios.nagios
还需要把 web用户 加入到 nagios组里 这样才有权限执行 nagios.cmd

问题5: 3D浏览错误 提示下载 statuswrl.cgi

解决: 需安装3D浏览插件