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.
cfg_dir - not finding my file?
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: cfg_dir - not finding my file?
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?
I can do that - but it does seem to imply that 'cfg_dir' is not working properly.
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: cfg_dir - not finding my file?
Defining the directory does not include all of the config files, you need to manually specify new ones that you create, such as:
Etc..
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?
Then the docs need to be updated.Defining the directory does not include all of the config files, you need to manually specify new ones that you create
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.
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: cfg_dir - not finding my file?
I'm not sure which doc you are referring to? Can you link it?