0

I followed the instructions from here: https://support.nagios.com/forum/viewtopic.php?f=7&t=56970 And now nagios prompts me to log in. It is correctly parsing the username/password.

Unfortunately, I still cannot access some functions and I get this error:

It appears as though you do not have permission to view information for any of the hosts you requested...

Here is my apache2.conf file:

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>

I am trying to access it from another host. My IP range is 10.13.0.0. I would appreciate any suggestions anyone may have!

  • I have tried disabling authentication in the apache configuration file, but I still have problems issuing commands via the web page. I still get the "It appears as though you do not have permission to view information for any of the hosts you requested..." error – jordanthompson Apr 28 '20 at 22:43
  • If I could completely disable user authorization, that would fine also. This is on a home server (behind a firewall) with limited access. – jordanthompson Apr 30 '20 at 23:24

1 Answers1

0

Below is working for me. Could vary I suppose depending on other steps taken. Before this step and right after installation I just did

sudo htdigest -c /etc/nagios4/htdigest.users Nagios4 nagiosadmin

Then I commented a few more lines than you did

#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>

And in the next step I set

use_authentication=1

in

/etc/nagios4/cgi.cfg

vikjon0
  • 1
  • 1