<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.10">
</HEAD>
<BODY>
Hi all,<BR>
<BR>
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.<BR>
<BR>
So i added support of environment variable for cgi config file name setting.<BR>
<BR>
I hope this could be inserted in nagios dev stream.<BR>
<BR>
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.<BR>
<BR>
In order to use it, you have to load apache env module and declare in "NAGIOS/etc/apache.conf" :<BR>
<BR>
SetEnv  NAGIOS_CGI_CONFIG_FILE /path/to/cgi/config/filename<BR>
<BR>
*** CUT diff cgiutils.c v1.2 ***<BR>
240,250d239<BR>
< /* retrieve cgi config file name first from environment variable then by parameter given from locations.h */<BR>
< char* get_cgi_config_file_by_env(char *filename)<BR>
< {<BR>
<       char *env=0;<BR>
<<BR>
<       if( env=getenv("NAGIOS_CGI_CONFIG_FILE") )<BR>
<               return env;<BR>
<<BR>
<       return filename;<BR>
< }<BR>
<<BR>
*** CUT HERE ***<BR>
<BR>
*** CUT diff locations.h.in v1.2 ***<BR>
34c34<BR>
< #define DEFAULT_CGI_CONFIG_FILE                       get_cgi_config_file_by_env("@sysconfdir@/cgi.cfg")<BR>
---<BR>
> #define DEFAULT_CGI_CONFIG_FILE                       "@sysconfdir@/cgi.cfg"<BR>
*** CUT HERE ***<BR>
<BR>
*** CUT diff cgiutils.h.in v1.2 ***<BR>
389a390<BR>
> char * get_cgi_config_file_by_env(char *);<BR>
*** CUT HERE ***<BR>
<BR>
<BR>
Regards,<BR>
<BR>
stef
</BODY>
</HTML>