sugested update for location.h.in

Marcel J.E. Mol marcel at mesa.nl
Thu Oct 14 16:05:43 CEST 2010


On Thu, Oct 14, 2010 at 10:56:56AM +0200, Andreas Ericsson wrote:
> On Wed, Oct 13, 2010 at 9:47 PM, Marcel J.E. Mol <marcel at mesa.nl> wrote:
> > Hello,
> >
> > My first post to the list... I just started playing with nagios and doing
> > some test developments. For this I need the location of the directory
> > where all config files reside. I noticed that all config files are defined
> > with absolute paths and the config directory itself is not defined.
> >
> > It like to suggest a change to location.h.in so I can define new config
> > files within a single source file without needing to update other nagios
> > core files.  The patch is attached. It just adds a DEFAULT_CONFIG_DIR
> > define to location.h.in.
> >
> 
> The default value for that macro would cause Nagios to recursively search
> all of /etc for files ending with .cfg.

I think you mistake this with the runtime definition with of cfg_dir in
nagios.cfg.

The suggested define in location.in.h is only a compile time
definition. It allows me to create new source files, say myproject.c
and in it do something like

  fp = open(DEFAULT_CONFIG_DIR "myproject.cfg");

without tampering other nagios source files while being flexible at where
the config files reside.  In the current situation I need to create a
file that is processed by the configure step to set the correct place
for config files.

> Try the cfg_dir option in nagios.cfg instead. It should do roughly what you
> want.

So it has nothing to do with cfg_dir...


-Marcel
-- 
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        marcel at mesa.nl                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list