cgi.cfg is an empty file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

cgi.cfg is an empty file

Post 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!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: cgi.cfg is an empty file

Post by slansing »

Can you post a copy of your cgi.cfg file please? Also, a copy of your nagios vhosts configuration as well. Thanks!
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Re: cgi.cfg is an empty file

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: cgi.cfg is an empty file

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Re: cgi.cfg is an empty file

Post by isadmin »

ok Thanks and yes their perms seem messed up...
It appears this happened two updates ago?
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Re: cgi.cfg is an empty file

Post by isadmin »

recovering old cgi.cfg from a backup which has the correct permissions...
just wondering how this could have happened...
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Re: cgi.cfg is an empty file

Post by isadmin »

Problem resolved :D
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: cgi.cfg is an empty file

Post by slansing »

Ah figured it would be a permissions issue, thanks for letting us know!
Locked