我遵循网络上指南中的简单步骤:
a) 通过命令向 Nagios 添加用户 htpasswd htpasswd.users username
b) 在 cgi.cfg 文件中将此用户添加到行:
authorized_for_system_information=nagiosadmin, username
authorized_for_configuration_information=nagiosadmin, username
authorized_for_system_commands=nagiosadmin, username
authorized_for_all_services=nagiosadmin, username
authorized_for_all_hosts=nagiosadmin, username
authorized_for_all_service_commands=nagiosadmin, username
authorized_for_all_host_commands=nagiosadmin, username
Run Code Online (Sandbox Code Playgroud)
c) 重启nagios3服务,甚至重启apache2服务
但是当我尝试从 nagios 网络界面列出任何内容时,它仍然给我这个恼人的消息:
It appears as though you do not have permission to view information for any of the services 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.
Run Code Online (Sandbox Code Playgroud)
请问哪里有问题?
Ste*_*ski 10
查看No permission to view configuration 中的 Nagios 常见问题解答,其中说:
说明:如果您单击“查看配置”并得到:“”“您似乎没有权限查看您请求的配置信息...如果您认为这是一个错误,请检查 HTTP 服务器身份验证要求用于访问此 CGI 并检查 CGI 配置文件中的授权选项。"""
解决方法:需要在cgi.cfg中设置“authorized_for_configuration_information”
在我的 EL6 系统上,默认情况下,'authorized_for_configuration_information' 设置为 'nagiosadmin'。许多网站将此设置为authorized_for_configuration_information=*,这可以解决您的问题。
此外,请确保您正确使用 HTTP 身份验证。见http://nagios.sourceforge.net/docs/3_0/cgiauth.html
在 CGI 中启用身份验证/授权功能
您需要做的下一件事是确保将 CGI 配置为使用身份验证和授权功能来确定用户可以访问哪些信息和/或命令。这是通过将 CGI 配置文件中的 use_authentication 变量设置为非零值来完成的。例子:
use_authentication=1
小智 5
编辑 /usr/local/nagios/etc/cgi.cfg
添加用户名,没有像这样的任何空格
authorized_for_system_information=nagiosadmin,username,username2
Run Code Online (Sandbox Code Playgroud)
使用 service nagios restart 保存文件并重新启动 nagios 服务
| 归档时间: |
|
| 查看次数: |
42003 次 |
| 最近记录: |