Page 1 of 1

Can Nagios call a .cfg from within an existing .cfg file

Posted: Sun Oct 28, 2012 8:03 pm
by ceslick
Hi,

Pretty new to Nagios and this is what I'd like to do, is it possible?

I wamt to create a host definition file with only the host information, then have it process 2 services .cfg files, one OS specific and one application specific for monitoring. These service .cfg files will be generic with no host information in them, just service details.

I would like these service .cfg files to be called from the host.cfg file and processed as if they were in the host.cfg file, inheriting all the host definitions.


Any way to do this, or thoughts how?

Thanks

Re: Can Nagios call a .cfg from within an existing .cfg file

Posted: Mon Oct 29, 2012 7:16 pm
by malvika
As far as I know, in nagios everything is shared and available to all files.
You can define in one file can use in another.
Use hostgroups to bundle hosts together and use the hostgroup in service.

Re: Can Nagios call a .cfg from within an existing .cfg file

Posted: Tue Oct 30, 2012 9:49 am
by mguthrie
No, you can't call a cfg within another cfg. However, you can use templates, and you can also apply services to an entire hostgroup. See the below docs:
http://nagios.sourceforge.net/docs/3_0/ ... ricks.html
http://nagios.sourceforge.net/docs/3_0/ ... tance.html