changing location of cgi.cfg file

Arno Lehmann al at its-lehmann.de
Mon May 23 19:54:14 CEST 2005


Hello,

Steve Ensley wrote:

> The web front end (NagiosQL) I'm configuring for use with Nagios 2
> assumes the configuration is in a directory structure off /etc/nagios.
>   I've gotten everything working reasonably well except, and I know
> this is probably a painfully stupid question, but I cant find where to
> properly tell nagios where to find the cgi.cfg file.  There doesnt
> seem to be a option for it in nagios.cfg,

Right... the cgis need to read their config without first referencing 
the main configuration.
And, of course, you can't pass an argument with the path to the cgi.cfg 
file to the cgis (at least, you really shouldn't...)

Conclusion: The cgi.cfg file name and path must be compiled in, thus you 
have
> elf:~ # strings /usr/lib/nagios/cgi/tac.cgi | grep cgi.cfg
> /etc/nagios/cgi.cfg
> <LI>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 <b>cgi.cfg</b>) can be found in the <b>sample-config/</b> subdirectory of the Nagios source code distribution.

I assume the parameter to ./configure should be --sysconfdir=DIR

Seems like you have to rebuild the cgis for your setup.

Arno

>  I tried a cfg_file=
> directive for it but it choked on that on startup.  The manual refers
> to the "usual" location for the cgi.cfg file but doesnt seem to
> mention how to make it an unusual location.
> 
> If its in /usr/local/nagios/etc, nagios is happy but NagiosQL cant
> find it unless I configure nagiosql to look for it there (I would
> prefer to keep all the config files together).  If I put it in
> /etc/nagios where NagiosQL would like to find it by default then
> nagios starts OK but when you click on an option on the nagios web
> interface it chokes with "Error: Could not open CGI config file
> '/usr/local/nagios/etc/cgi.cfg' for reading!"  which of course is not
> where it should be looking for it.
>  
> I can make everything work by creating a symbolic link to
> /etc/nagios/cgi.cfg in /usr/local/nagios/etc/ but that's a clumsy hack
> and there is undoubtedly a proper way to change this.
> 

-- 
IT-Service Lehmann                    al at its-lehmann.de
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list