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

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
ceslick
Posts: 1
Joined: Sun Oct 28, 2012 7:56 pm

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

Post 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
malvika
Posts: 2
Joined: Mon Sep 19, 2011 4:13 pm

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

Post 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.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

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

Post 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
Locked