Page 1 of 1
cfg_dir - not finding my file?
Posted: Sun Oct 06, 2013 7:07 am
by ethrbunny
In 'nagios.cfg' I have the 'cfg_dir' set to '<nagios path>/etc/objects'. It seems to find the usual suspects just fine (hosts.cfg,services.cfg, etc). Today I added a file 'sans.cfg' with the same layout as my 'hosts.cfg' file but it isn't getting picked up. Is there another setting required to add new files like this?
No errors are shown at the validation. Nothing in the log file either.
Re: cfg_dir - not finding my file?
Posted: Mon Oct 07, 2013 9:36 am
by slansing
Have you tried explicitly defining that config name in the nagios.cfg? Just as shown above with hosts, services, etc? Then restart nagios after verifying your configs.
Re: cfg_dir - not finding my file?
Posted: Mon Oct 07, 2013 10:09 am
by ethrbunny
I can do that - but it does seem to imply that 'cfg_dir' is not working properly.
Re: cfg_dir - not finding my file?
Posted: Mon Oct 07, 2013 11:06 am
by slansing
Defining the directory does not include all of the config files, you need to manually specify new ones that you create, such as:
Code: Select all
cfg_file=/usr/local/nagios/etc/servicegroups.cfg
cfg_file=/usr/local/nagios/etc/hosttemplates.cfg
cfg_file=/usr/local/nagios/etc/servicetemplates.cfg
Etc..
Re: cfg_dir - not finding my file?
Posted: Thu Oct 10, 2013 7:58 am
by ethrbunny
Defining the directory does not include all of the config files, you need to manually specify new ones that you create
Then the docs need to be updated.
This directive is used to specify a directory which contains object configuration files that Nagios should use for monitoring. All files in the directory with a .cfg extension are processed as object config files.
Re: cfg_dir - not finding my file?
Posted: Thu Oct 10, 2013 9:28 am
by slansing
I'm not sure which doc you are referring to? Can you link it?