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 17:23, AL13N wrote:
>> 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.
>

There's "cfg_dir".

> 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.
>

True that. Nonexisting path should be an error though.

>> 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.
>

True that. And I supposed adding the include statements later wouldn't
be that much work, so whatever you're comfortable implementing would be
great.

> 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.
>

Yea, probably.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked