Re: [Nagios-devel] configuration directory

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] configuration directory

Post by Guest »

> 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=3D/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=3D/etc/nagios/defaults.cfg
> include=3D/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=3D 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=3D statement, and it would b=
e 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.






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: alien@rmail.be
Locked