Page 1 of 1

"It appears as though you do not have... " for nagiosadmin

Posted: Tue Jan 21, 2014 4:14 am
by johnsmith
Hello,

I'm trying to access the Nagios CGI with the nagiosadmin user but I always get the message: "It appears as though you do not have permission to view information for any of the hosts you requested..."

The user is defined in the htpasswd file and the web server requires authentication as expected: I'm prompted for the login and password. The nagiosadmin user is also defined as contact for all servers, and the cgi.cfg file lists it in all authorized_for_* settings. The admins group contains the nagiosadmin user, and this group is the contact_groups of the default generic-host entry: nothing fancy here. This user does receive email alerts for all hosts.

The server runs Ubuntu 12.04.2 LTS, with stock versions of Apache, PHP & Nagios Core (3.2.3-3ubuntu1). I've installed NC on another server (same version) with a very similar setting and that one works fine: I can't find any relevant difference.

I've searched the web but to no avail, all pages I've found explain how to configure the admin user. Any help appreciated!


Here's my cgi.cfg file content:

main_config_file=/etc/nagios3/nagios.cfg
physical_html_path=/usr/share/nagios3/htdocs
url_html_path=/nagios3
show_context_help=1
use_pending_states=1
nagios_check_command=/usr/lib/nagios/plugins/check_nagios /var/cache/nagios3/status.dat 5 '/usr/sbin/nagios3'
use_authentication=1
use_ssl_authentication=0
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
default_statusmap_layout=5
default_statuswrl_layout=4
ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
refresh_rate=90
escape_html_tags=1
action_url_target=_blank
notes_url_target=_blank
lock_author_names=1

Re: "It appears as though you do not have... " for nagiosadm

Posted: Tue Jan 21, 2014 9:35 am
by johnsmith
Actually I noticed that the user in the main page was not recognized properly: I was "Logged in as ?". With this hint I found out that my apache config file (/etc/apache2/conf.d/nagios3.conf) was missing the following lines:

Code: Select all

<Location /cgi-bin/nagios3>
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios3/htpasswd.users
    require valid-user
</Location>
After reloading apache the server list was displayed properly. I'm not sure if I had mistakenly removed those lines or if they weren't included in the packaged file.

Re: "It appears as though you do not have... " for nagiosadm

Posted: Tue Jan 21, 2014 10:26 am
by tmcdonald
Yea that is weird that the line would be missing. But at any rate, is this all resolved? If so I'll be closing the thread.

Re: "It appears as though you do not have... " for nagiosadm

Posted: Tue Jan 21, 2014 10:31 am
by johnsmith
Yes, my problem is solved. You can close the thread.