我按照这里的说明进行操作: 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