Nagios Installer
Marc Powell
lists at xodus.org
Thu Apr 1 13:44:40 CEST 2010
On Mar 31, 2010, at 1:00 PM, Mohammed Murphy wrote:
> Hello again,
>
> Thanks for all your help and answers two weeks ago. I have come up with
> a few more questions that need answering. In this email, I want to ask
> about how Nagios finds the main Nagios configuration file and the
> cgi/plugins directory.
The location of nagios.cfg is hard coded into the binary at compile time.
The daemon has no need to know where the CGI's are.
The daemon knows the location of each specific plugin from the command_line in each command{} definition.
> I wondered if there
> were any helpful environment variables which are set when Nagios is
> installed which would allow the installer-type application to find the
> required paths automatically. Or whether there is a well-known
> methodology for tackling this kind of problem.
None that I know of. You could auto-search the common locations based on distributions (/usr/local/nagios/etc; /etc/nagios; others?) and/or confirm with the person running your script.
There are several macros that you are interested in that are available (http://nagios.sourceforge.net/docs/3_0/macrolist.html#mainconfigfile) that could be made available as environment macros but I believe that they are only visible to programs launched by the nagios daemon itself (plugins, notifications, etc). su to the nagios user and 'echo $NAGIOS_MAINCONFIGFILE' to test (assuming you've enable macros as environment variables in nagios.cfg).
--
Marc
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
More information about the Developers
mailing list