Page 1 of 1

Service Dependency Clarification

Posted: Thu Jun 26, 2014 10:31 pm
by rajasegar
Nagios XI 2014R1.2 Ent Edition
27-06-2014 11-23-35 AM.png
I know how the Service Dependency works for the same host or 1 other host with 1 to 1 service dependency.

What is the behavior if I select HostGroup for Manage Hostgroup and Manage Dependent Hostgroup?

Re: Service Dependency Clarification

Posted: Thu Jun 26, 2014 10:58 pm
by Box293
It can save you having to create lots of individual dependencies.

There are some good examples here:
http://nagios.sourceforge.net/docs/3_0/ ... ricks.html

I think this example says it best:

All Hosts In Multiple Hostgroups:
If you want to create service dependencies for services of the same name/description that are assigned to all hosts in in one or more hostgroups, you can do use the hostgroup_name and/or dependent_hostgroup_name directives. In the example below, service SERVICE2 on all hosts in hostgroups HOSTGROUP3 and HOSTGROUP4 would be dependent on service SERVICE1 on all hosts in hostgroups HOSTGROUP1 and HOSTGROUP2. Assuming there were five hosts in each of the hostgroups, this definition would be equivalent to creating 100 single service dependency definitions! All the instances of the service dependency would be identical except for the host names (i.e. have the same notification failure criteria, etc.).

Code: Select all

define servicedependency{
	hostgroup_name			HOSTGROUP1,HOSTGROUP2
	service_description			SERVICE1
	dependent_hostgroup_name	HOSTGROUP3,HOSTGROUP4
	dependent_service_description	SERVICE2
	other dependency directives ...
	}

Re: Service Dependency Clarification

Posted: Fri Jun 27, 2014 1:07 am
by rajasegar
Box293 wrote:It can save you having to create lots of individual dependencies.

There are some good examples here:
http://nagios.sourceforge.net/docs/3_0/ ... ricks.html

I think this example says it best:

All Hosts In Multiple Hostgroups:
If you want to create service dependencies for services of the same name/description that are assigned to all hosts in in one or more hostgroups, you can do use the hostgroup_name and/or dependent_hostgroup_name directives. In the example below, service SERVICE2 on all hosts in hostgroups HOSTGROUP3 and HOSTGROUP4 would be dependent on service SERVICE1 on all hosts in hostgroups HOSTGROUP1 and HOSTGROUP2. Assuming there were five hosts in each of the hostgroups, this definition would be equivalent to creating 100 single service dependency definitions! All the instances of the service dependency would be identical except for the host names (i.e. have the same notification failure criteria, etc.).

Code: Select all

define servicedependency{
	hostgroup_name			HOSTGROUP1,HOSTGROUP2
	service_description			SERVICE1
	dependent_hostgroup_name	HOSTGROUP3,HOSTGROUP4
	dependent_service_description	SERVICE2
	other dependency directives ...
	}
Thanks. Nagios documentation is not as clear as this explanation. :P

Re: Service Dependency Clarification

Posted: Fri Jun 27, 2014 10:28 am
by tmcdonald
Thank you Box for the post!

rajasegar, did you have any other questions regarding service dependencies or shall I close this thread?

Re: Service Dependency Clarification

Posted: Sun Jun 29, 2014 6:08 pm
by rajasegar
tmcdonald wrote:Thank you Box for the post!

rajasegar, did you have any other questions regarding service dependencies or shall I close this thread?
Please close this thread. Thanks