I'll try my best to answer this for the Nagios related parts, but some of it actually is package related since it has been changed.
Can I leave that in directive as is, then override it with a different value for cfg_dir later in the file or included files?
If so, Is redefinition-allowed, last-seen-wins the rule 100% throughout nagios?
I'm not sure exactly what you're asking here, but I'll try to explain.
cfg_dir= can be called to as many different times as you wanted. You could set up your nagios.cfg like this (where ... represents other parts of the config file) -
Code: Select all
...
cfg_dir=/etc/nagios3/conf.d/hosts/
cfg_dir=/etc/nagios3/conf.d/services/
...
This would tell Nagios to look for configurations in both the /etc/nagios3/conf.d/hosts/ and /etc/nagios3/conf.d/services/ for any object definitions. You could also change this to something like -
Code: Select all
...
cfg_dir=/path/to/my/dir/hosts/
...
The only important thing is that the user running nagios can access the files here.
2. If for example cfg_dir was not defined in any of those files under /etc, are there inherent nagios defaults for settings like cfg_dir?
No. As for settings have defaults, and others don't - this is a pretty broad question so I'm not sure how to answer it further.
Some software has default config under /etc which consists entirely of commented settings illustrating the inherent defaults. I'm wondering if Nagios has the same.
The package you mentioned is configured for /etc/nagios3/, where as our default core installs actually use the /usr/local/nagios/ path. This gets into not knowing completely what paths are being used. Core can be compiled however you want, and you can change up the paths as needed. See this guide for a source install instructions -
https://support.nagios.com/kb/article.p ... ategory=58