configuration directory
AL13N
alien at rmail.be
Wed Sep 4 17:23:24 CEST 2013
> On 2013-09-04 12:51, AL13N wrote:
[...]
> No. All variables from one file should be parsed before any variables
> from a different file, but the include-files from one file get parsed
> before we move along to the next file in that directory.
>
> If we pretend that /etc/nagios/conf.d contains two files, named A.cfg
> and B.cfg, where A.cfg has "include=/etc/nagios/perfdata.cfg" and the
> main nagios config file is /etc/nagios/nagios.cfg, but one also wants
> to oneshot parse /etc/nagios/debug.cfg, then one would execute Nagios
> like so:
>
> nagios -d /etc/nagios/nagios.cfg /etc/nagios/debug.cfg
>
> and with the above settings we would parse
> /etc/nagios/nagios.cfg nagios.cfg (all settings)
> /etc/nagios/conf.d/A.cfg (all settings)
> /etc/nagios/perfdata.cfg (all settings)
> /etc/nagios/conf.d/B.cfg (all settings)
> /etc/nagios/debug.cfg (all settings)
>
> In practice though, I expect the default settings will be so that
> /etc/nagios/nagios.cfg contains this:
> include=/etc/nagios/defaults.cfg
> include=/etc/nagios/conf.d
>
> Btw, we shouldn't error out when encountering an empty directory,
> but rather just print a warning about it. Or even have "include_dir"
> and "include_file", where both cause an error if the targeted path
> doesn't exist, although we allow empty directories.
i think there's a include_dir for hosts and such? or it might be named
differently.
i think one include= setting is enough to check file and dir, and empty
dir shouldn't get an error... i don't think it needs a warning, since it
will often be used in this way, where the user can add stuff in an empty
directory.
> I just realized that this includes the "parse multiple config files
> from command-line", but since that's hardly a difficult issue once
> we can parse multiple config files, I doubt that's a problem.
this is what i figured first, so i thought it would not be needed to have
an extra setting that includes other files/dirs.
my original thought was to:
A) allow multiple files on command line
B) allow them to be directories too (expanding to multiple files)
then there would be no real need for include= statement, and it would be a
less intrusive (and less work) patch.
the distro will likely choose what files/dirs to be used in what order
(and put this in the initscript/service file), so i figured that this
would be enough.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
More information about the Developers
mailing list