CGI Patch for Nagios 1.0b6

Russell Scibetti russell at quadrix.com
Fri Sep 20 17:52:09 CEST 2002


I previously submitted a patch file for Nagios1.0b3 that would allow for 
the CGI's to be truly portable, as in no need to reconfigure or remake 
whenever you wanted to move them or have multiple instances of the CGI's 
on the same box.  What I did was added a method to the cgiutils.c class 
to get the location of the cgi.cfg file from an environment variable, 
NAGIOS_CGI_CONFIG.  If there is no environment variable set, then it 
will do what Nagios currently does and use the hard-coded value in the 
locations.h file (created with you ran ./configure).

The patch never made it to the 1.0b6 release, so I recreated it and 
attached it to this email.  It's easy to run.  All you have to do is, 
before you do a make (after ./configure), copy this patch file into the 
/nagios-1.0b6/cgi directory and type patch -p1 < nagios1.0b6-cgi.patch 
and it will edit the cgi's properly.  Then to set the environment 
variable, you need to edit your httpd.conf.  I know how to do this for 
Apache (you need version 1.3.7 or higher).  Inside the Directory entry 
you made for the /nagios/cgi-bin path you add the line:

    SetEnv NAGIOS_CGI_CONFIG /usr/local/nagios/etc/cgi.cfg

Obviously change the value to be wherever your cgi.cfg is located.  So 
if you ahve multiple set of CGI's running on one box (like we do here), 
for each different Directory entry, set the environment variable 
appropriately and all the CGI's will work fine.

This is the only hardcoded reference the CGI's use.  Inside cgi.cfg is 
the location of the main cfg file (nagios.cfg), and the cgi's parse the 
rest of the information they need from there.  Just make sure that you 
have all your directory and file settings set properly in the config files.

I'd really like to see this change added to the distribution.  It allows 
for CGI portability and it is completely backward compatible.  If 
someone can let me know how I can go about having this added to the 
normal Nagios distribution, I'd really appreciate it.  Thanks.

-Russell Scibetti

-- 
Russell Scibetti
Quadrix Solutions, Inc.
http://www.quadrix.com
(732) 235-2335, ext. 7038

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nagios1.0b6-cgi.patch
URL: <https://www.monitoring-lists.org/archive/users/attachments/20020920/89a0cb3c/attachment.ksh>


More information about the Users mailing list