Nagios hosting & CGI config path

Andreas Ericsson ae at op5.se
Mon Jan 17 18:24:13 CET 2005


Jason Martin wrote:
> I'm looking to set up a machine such that several groups can
> each own their own Nagios instance. I'd like to be able to set
> up a new environment pretty easily as I expect more groups will
> want one as the service grows. I forsee a problem with the CGI's
> since the path to their config file must be set at compile time.
> Although it is feasible to automate a ./configure [..]; make;
> make install, I'd like to have all the instance share one set of
> binaries. 
> 
> May I suggest that the CGI's be modified to accept the path to
> the cgi.cfg from an environmental variable passed from the
> webserver? It could function as an override to the compiled-in
> default.  That way creating a new environment will just require
> creating some config dirs and writing some text to the webserver
> config. 
> 

Thay already do. Lines 238-248 of cgiutils.c;
char * get_cgi_config_location(void){
	if(!cgiloc) {
		cgiloc=getenv("NAGIOS_CGI_CONFIG");
		if(!cgiloc) cgiloc=DEFAULT_CGI_CONFIG_FILE;
	}
	return cgiloc;
}
... and so on and so forth.
It also supports NAGIOS_COMMAND_FILE.
In cgi.cfg you can set all the other variables you could possibly need.


> Thanks,
> -Jason Martin

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt




More information about the Developers mailing list