![Nagios4 提示输入用户名/密码,但登录后功能有限](https://linux22.com/image/751675/Nagios4%20%E6%8F%90%E7%A4%BA%E8%BE%93%E5%85%A5%E7%94%A8%E6%88%B7%E5%90%8D%2F%E5%AF%86%E7%A0%81%EF%BC%8C%E4%BD%86%E7%99%BB%E5%BD%95%E5%90%8E%E5%8A%9F%E8%83%BD%E6%9C%89%E9%99%90.png)
我按照这里的说明进行操作: https://support.nagios.com/forum/viewtopic.php?f=7&t=56970 现在 nagios 提示我登录。它正在正确解析用户名/密码。
不幸的是,我仍然无法访问某些功能,并且收到此错误:
看起来您没有权限查看您请求的任何主机的信息......
这是我的 apache2.conf 文件:
listen 8080
<VirtualHost *:8080>
ScriptAlias /cgi-bin/nagios4 /usr/lib/cgi-bin/nagios4
ScriptAlias /nagios4/cgi-bin /usr/lib/cgi-bin/nagios4
Alias /nagios4/stylesheets /etc/nagios4/stylesheets
Alias /nagios4 /usr/share/nagios4/htdocs
<Directory /usr/share/nagios4/htdocs>
Options +ExecCGI
# SSLRequireSSL
Options None
AllowOverride None
<RequireAll>
Require all granted
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios4/htdigest.users
Require valid-user
</RequireAll>
</Directory>
<DirectoryMatch (/usr/lib/cgi-bin/nagios4|/etc/nagios4/stylesheets)>
Options FollowSymLinks
DirectoryIndex index.php index.html
AllowOverride AuthConfig
Require ip ::1/128 fc00::/7 fe80::/10 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16 172.16.0.0/12 192.168.0.0/16 10.13.0.0/16
<Files "cmd.cgi">
AuthDigestDomain "Nagios4"
AuthDigestProvider file
AuthUserFile "/etc/nagios4/htdigest.users"
AuthGroupFile "/etc/group"
AuthName "Nagios4"
#AuthType Digest
AuthType Basic
#Require all granted
Require valid-user
</Files>
</DirectoryMatch>
#<Directory /usr/share/nagios4/htdocs>
# Options +ExecCGI
#</Directory>
</VirtualHost>
我正在尝试从另一台主机访问它。我的 IP 范围是 10.13.0.0。如果有人能提供任何建议,我将不胜感激!
答案1
下面对我有用。我猜可能会有所不同,具体取决于所采取的其他步骤。在此步骤之前和安装后我刚刚做了
sudo htdigest -c /etc/nagios4/htdigest.users Nagios4 nagiosadmin
然后我评论了几行比你多
#Require ip ::1/128 fc00::/7 fe80::/10 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16 172.16.0.0/12 192.168.0.0/16 #<Files "cmd.cgi"> AuthDigestDomain "Nagios4" AuthDigestProvider file AuthUserFile "/etc/nagios4/htdigest.users" AuthGroupFile "/etc/group" AuthName "Nagios4" AuthType Digest #Require all granted Require valid-user #</Files>
下一步我设置
使用身份验证=1
在
/etc/nagios4/cgi.cfg