Page 1 of 1

cgi.cfg is an empty file

Posted: Mon Jul 08, 2013 8:54 am
by isadmin
Hello,
This is a Centos VM Appliance

Having an issue with the Web interface....
We can view Host Detail but the
cgi.cfg file is empty and

Whenever we try to view
service detail
hostgroup summary
hostgroup overview
hostgroup Grid
ServiceGroup Summary
ServiceGroup Overview
Service Grid we receive the following error...

Error: Could not open CGI config file '/usr/local/nagios/etc/cgi.cfg' for reading!

Here are some things you should check in order to resolve this error:

Make sure you've installed a CGI config file in its proper location. See the error message about for details on where the CGI is expecting to find the configuration file. A sample CGI configuration file (named cgi.cfg) can be found in the sample-config/ subdirectory of the Nagios source code distribution.
Make sure the user your web server is running as has permission to read the CGI config file.

Make sure you read the documentation on installing and configuring Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.

Thanks!

Re: cgi.cfg is an empty file

Posted: Mon Jul 08, 2013 10:27 am
by slansing
Can you post a copy of your cgi.cfg file please? Also, a copy of your nagios vhosts configuration as well. Thanks!

Re: cgi.cfg is an empty file

Posted: Mon Jul 08, 2013 10:37 am
by isadmin
the cgi.cfg is actually 0 bytes? Nothing to post? located here(usr/local/nagios/etc/cgi.cfg)
Where would I find the vhosts info you need?

Re: cgi.cfg is an empty file

Posted: Mon Jul 08, 2013 1:50 pm
by abrist
Here is a default copy of the cgi.cfg for XI:

Code: Select all

# MODIFIED
default_statusmap_layout=6

#default_user_name=guest
# UNMODIFIED
action_url_target=_blank
authorized_for_all_host_commands=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_system_information=nagiosadmin
default_statuswrl_layout=4
escape_html_tags=1
lock_author_names=1
main_config_file=/usr/local/nagios/etc/nagios.cfg
notes_url_target=_blank
physical_html_path=/usr/local/nagios/share
ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
refresh_rate=90
show_context_help=0
url_html_path=/nagios
use_authentication=1
use_pending_states=1
use_ssl_authentication=0
All of your XI users may have messed up permissions concerning these cgis if the file is missing. You will have to add them to the appropriate "authorized_*" lines (comma separated) to match their users settings.

Re: cgi.cfg is an empty file

Posted: Tue Jul 09, 2013 7:45 am
by isadmin
ok Thanks and yes their perms seem messed up...
It appears this happened two updates ago?

Re: cgi.cfg is an empty file

Posted: Tue Jul 09, 2013 8:13 am
by isadmin
recovering old cgi.cfg from a backup which has the correct permissions...
just wondering how this could have happened...

Re: cgi.cfg is an empty file

Posted: Tue Jul 09, 2013 9:47 am
by isadmin
Problem resolved :D

Re: cgi.cfg is an empty file

Posted: Tue Jul 09, 2013 12:54 pm
by slansing
Ah figured it would be a permissions issue, thanks for letting us know!