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