<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2656.60">
<TITLE>RE : [Nagios-users] changing location of cgi.cfg file</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Put your path in the NAGIOS_CGI_CONFIG environment variable (via apache's setenv). Nagios looks for this variable before using the default path. Same for NAGIOS_COMMAND_FILE. There is no way to configure it in the main configuration file because the main cfg file is referenced from the cgi cfg file. For a CGI, the only entry point is the cgi cfg.</FONT></P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Steve Ensley [<A HREF="mailto:steve.ensley@gmail.com">mailto:steve.ensley@gmail.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Monday, May 23, 2005 6:57 PM</FONT>
<BR><FONT SIZE=2>To: Nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>Subject: [Nagios-users] changing location of cgi.cfg file</FONT>
</P>
<BR>

<P><FONT SIZE=2>The web front end (NagiosQL) I'm configuring for use with Nagios 2 assumes the configuration is in a directory structure off /etc/nagios.</FONT></P>

<P><FONT SIZE=2>  I've gotten everything working reasonably well except, and I know this is probably a painfully stupid question, but I cant find where to properly tell nagios where to find the cgi.cfg file.  There doesnt seem to be a option for it in nagios.cfg,  I tried a cfg_file= directive for it but it choked on that on startup.  The manual refers to the "usual" location for the cgi.cfg file but doesnt seem to mention how to make it an unusual location.</FONT></P>

<P><FONT SIZE=2>If its in /usr/local/nagios/etc, nagios is happy but NagiosQL cant find it unless I configure nagiosql to look for it there (I would prefer to keep all the config files together).  If I put it in /etc/nagios where NagiosQL would like to find it by default then nagios starts OK but when you click on an option on the nagios web interface it chokes with "Error: Could not open CGI config file '/usr/local/nagios/etc/cgi.cfg' for reading!"  which of course is not where it should be looking for it.</FONT></P>

<P><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>I can make everything work by creating a symbolic link to /etc/nagios/cgi.cfg in /usr/local/nagios/etc/ but that's a clumsy hack and there is undoubtedly a proper way to change this.</FONT></P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Steve</FONT>
</P>

<P><FONT SIZE=2>Knowledge is power... Power Corrupts.  Study hard... Be Evil.</FONT>
</P>
<BR>

<P><FONT SIZE=2>-------------------------------------------------------</FONT>
<BR><FONT SIZE=2>This SF.Net email is sponsored by Oracle Space Sweepstakes</FONT>
<BR><FONT SIZE=2>Want to be the first software developer in space?</FONT>
<BR><FONT SIZE=2>Enter now for the Oracle Space Sweepstakes! <A HREF="http://ads.osdn.com/?ad_idt12&alloc_id" TARGET="_blank">http://ads.osdn.com/?ad_idt12&alloc_id</A>344&op=click</FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>Nagios-users mailing list</FONT>
<BR><FONT SIZE=2>Nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2><A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-users" TARGET="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</A></FONT>
<BR><FONT SIZE=2>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. </FONT>
<BR><FONT SIZE=2>::: Messages without supporting info will risk being sent to /dev/null</FONT>
</P>

</BODY>
</HTML>