I've just spent the better part of the last 2 days trying to get the web interface to register the nagiosadmin user when I log in.
While the authentication works fine - I get asked for the user/password when I try to access the web interface, once I try to access any of the actual reports (like status.cgi, for example), I get the standard "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" error message.
I've also noticed that in the upper left-hand side I have "Logged in as ?" instead of the username(nagiosadmin).
I scrounged around the internets for a while and got the idea to check the global variable $REMOTE_USER, which supposedly should pass the username and all I've managed to achieve is a "Variable not set" error from PHP. For reference, the code was
Code: Select all
<?php
echo "REMOTE_USER = $REMOTE_USER";
?>
Code: Select all
echo "REMOTE_USER = ".$_SERVER['REMOTE_USER'];
Here is my apache configuration:
Code: Select all
<VirtualHost *:80>
DocumentRoot /usr/share/nagios/html
ServerName [REDACTED]
ScriptAlias /nagios/cgi-bin "/usr/lib64/nagios/cgi-bin"
<Directory "/usr/lib64/nagios/cgi">
# SSLRequireSSL
AddHandler cgi-script .cgi
AddHandler cgi-script .php
Options ExecCGI
AllowOverride None
# Order allow,deny
# Allow from all
Order deny,allow
Deny from all
Allow from [REDACTED]
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-user
</Directory>
Alias /nagios "/usr/share/nagios/html"
<Directory "/usr/share/nagios/html">
# SSLRequireSSL
Options None
AllowOverride None
# Order allow,deny
# Allow from all
Order deny,allow
Deny from all
Allow from [REDACTED]
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-user
</Directory>
ErrorLog logs/nagios-error_log
CustomLog logs/nagios-access_log common
</VirtualHost>
Code: Select all
authorized_for_system_information
authorized_for_system_commands
authorized_for_configuration_information
authorized_for_all_hosts
authorized_for_all_host_commands
authorized_for_all_services
authorized_for_all_service_commands
Does anyone have any ideas as to what I'm missing to get this thing to work properly?
Any thoughts are appreciated.
Reggie