centos 7.0 64位 安装好nagios 后不显示localhost 并出现:
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.
看了下/usr/local/nagios/etc 下的文件权限没发现问题,找了一些网上的资料,最后在一篇文章中发现原因:
nagios 的默认管理账户是 nagiosadmin,
而我们在安装的时候创建用户admin
[root@localhost etc]# htpasswd -c /usr/local/nagios/etc/htpasswd.users admin nagiosadmin是我们用来登录nagios的管理员,而cgi.cfg就是用来验证管理员身份的。 如果我们生成的管理员用户不是nagiosadmin,验证的时候就会失败,也就会出现开始上图描述的那个错误了。 所以,我们现在只要把配置文件里的用户名改为实际的管理员用户名,保存,再重新启动nagios即可!如创建的管理员账号为admin 解法方法如下:
1、编辑/usr/local/nagios/etc/cgi.cfg文件,修改以下几个选项的值为自己创建的管理的用户,其实也可以直接在后面加上我们创建的用户名,用逗号隔开即可,如下所示:
authorized_for_system_information=nagiosadmin,admin
authorized_for_configuration_information=nagiosadmin,admin
authorized_for_system_commands=nagiosadmin,admin
authorized_for_all_services=nagiosadmin,adimin
authorized_for_all_hosts=nagiosadmin,admin
authorized_for_all_service_commands=nagiosadmin,admin
authorized_for_all_host_commands=nagiosadmin,admin
改好后重启 nagios httpd OK
localhost有了 报错也没了,感谢作者
原文:http://www.cnblogs.com/5201351/p/4330204.html