[Nagios-devel] cgi config file name

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] cgi config file name

Post by Guest »

--=-+BQbMBL/i0TJCNmUrt0x
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

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
#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

--=-+BQbMBL/i0TJCNmUrt0x
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit








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



--=-+BQbMBL/i0TJCNmUrt0x--






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked