cgi config file name

duverger duverger at illicom.com
Mon Aug 9 16:23:07 CEST 2004


Hi all,

For H-A cluster purpose, i need to run 2 nagios on the same host. The
problem is that config file name for cgis is hard coded.

So i added support of environment variable for cgi config file name
setting.

I hope this could be inserted in nagios dev stream.

Since i do not work with cvs snapshots, i give you a kind of "diff file"
to see what as changed (very minor) in source code.

In order to use it, you have to load apache env module and declare in
"NAGIOS/etc/apache.conf" :

SetEnv  NAGIOS_CGI_CONFIG_FILE /path/to/cgi/config/filename

*** CUT diff cgiutils.c v1.2 ***
240,250d239
< /* retrieve cgi config file name first from environment variable then
by parameter given from locations.h */
< char* get_cgi_config_file_by_env(char *filename)
< {
<       char *env=0;
<
<       if( env=getenv("NAGIOS_CGI_CONFIG_FILE") )
<               return env;
<
<       return filename;
< }
<
*** CUT HERE ***

*** CUT diff locations.h.in v1.2 ***
34c34
< #define DEFAULT_CGI_CONFIG_FILE                      
get_cgi_config_file_by_env("@sysconfdir@/cgi.cfg")
---
> #define DEFAULT_CGI_CONFIG_FILE                      
"@sysconfdir@/cgi.cfg"
*** CUT HERE ***

*** CUT diff cgiutils.h.in v1.2 ***
389a390
> char * get_cgi_config_file_by_env(char *);
*** CUT HERE ***


Regards,

stef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20040809/d35a7a50/attachment.html>


More information about the Developers mailing list