2015-07-08平台崩溃nagios安装中报错解决.

<1>

# htpasswd -b /usr/local/nagios/etc/htpasswd.users uuwatch 1234+asdf                 //在现有用户下添加用户和密码

[root@slave1 ~]# cat /usr/local/nagios/etc/htpasswd.users
uuwatch:dJvuCrxb63E9E

(1)第一个报错

监控页面出现
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.


[root@slave1 ~]# cat -n /usr/local/nagios/etc/cgi.cfg|sed -n '78p'
    78    use_authentication=1 (1开启)

(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.原因 : 认证用户不正确

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

今日安装nagios时,在页面上出现监错误信息

It appears as though you do not have permission to view information you requested........

点击任何选项都是这个错误,郁闷了.

百度了下,好多文章基本都是一样,改cgi.cfg文件里的一个参数 use_authentication=1 将1改为0,重启nagios即可.

不过,这一项其实是nagios保证安全性的一个参数,我觉得改了之后,有可能会带来安全上的隐患,于是我仔细看了下这个文件里的内容,

终于让我发现问题所在啦!呵呵...

原来之所以出现这样的提示,主要还是身份验证的问题!!

还记得我们装nagios时生成的一个管理员帐号吗?

htpasswd ‐c /usr/local/nagios/etc/htpasswd.users nagiosadmin
nagiosadmin是我们用来登录nagios的管理员,而cgi.cfg就是用来验证管理员身份的!

如果你生成的管理员用户不是nagiosadmin,验证的时候就会失败,也就会出现开始我们描述的那个错误了!!

所以,我们现在只要把配置文件里的用户名改为实际的管理员用户名,保存,再重新启动nagios即可!

vi /usr/local/nagios/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

 

posted @ 2015-07-08 14:04  arun_yh  阅读(184)  评论(0编辑  收藏  举报