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

I have installed Nagios server in one of my machine, when I opened nagios in web-browser I got this error: ” It appears as though you do not have permission to view information for any of the hosts 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.”.  It looks like authorization issue.

nagios error

Nagios error

 

Open the CGI file. It will be under $YOUR_NAGIOS_HOME_DIRECTORY/etc/cgi.cfg. In my case, it is /usr/local/nagios/etc/cgi.cfg

# SYSTEM/PROCESS INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# have access to viewing the Nagios process information as
# provided by the Extended Information CGI (extinfo.cgi). By
# default, *no one* has access to this unless you choose to
# not use authorization. You may use an asterisk (*) to
# authorize any user who has authenticated to the web server.

authorized_for_system_information=nagiosadmin

# CONFIGURATION INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# can view ALL configuration information (hosts, commands, etc).
# By default, users can only view configuration information
# for the hosts and services they are contacts for. You may use
# an asterisk (*) to authorize any user who has authenticated
# to the web server.

authorized_for_configuration_information=nagiosadmin

# SYSTEM/PROCESS COMMAND ACCESS
# This option is a comma-delimited list of all usernames that
# can issue shutdown and restart commands to Nagios via the
# command CGI (cmd.cgi). Users in this list can also change
# the program mode to active or standby. By default, *no one*
# has access to this unless you choose to not use authorization.
# You may use an asterisk (*) to authorize any user who has
# authenticated to the web server.

authorized_for_system_commands=nagiosadmin

# GLOBAL HOST/SERVICE VIEW ACCESS
# These two options are comma-delimited lists of all usernames that
# can view information for all hosts and services that are being
# monitored. By default, users can only view information
# for hosts or services that they are contacts for (unless you
# you choose to not use authorization). You may use an asterisk (*)
# to authorize any user who has authenticated to the web server.
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
# GLOBAL HOST/SERVICE COMMAND ACCESS
# These two options are comma-delimited lists of all usernames that
# can issue host or service related commands via the command
# CGI (cmd.cgi) for all hosts and services that are being monitored.
# By default, users can only issue commands for hosts or services
# that they are contacts for (unless you you choose to not use
# authorization). You may use an asterisk (*) to authorize any
# user who has authenticated to the web server.

authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

Change the username “nagiosadmin” to “NagiosAdmin”. While installing nagios server I have added “NagiosAdmin” as my username. So replace “nagiosadmin” with your username in cgi.cfg file and save it.

Sometimes after editing cgi.cfg file, nagios restart might required. But in my case I have not restarted nagios and got updates on the screen.

# systemctl restart nagios.service
# systemctl status nagios.service
nagios.service - LSB: Starts and stops the Nagios monitoring server
   Loaded: loaded (/etc/rc.d/init.d/nagios)
   Active: active (running) since Mon 2015-08-31 14:47:07 BST; 6s ago
  Process: 20443 ExecStop=/etc/rc.d/init.d/nagios stop (code=exited, status=0/SUCCESS)
  Process: 20452 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)

nagios error

Nagios

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Add a Comment

Your email address will not be published. Required fields are marked *