Page 1 of 2

Configuring Nagios Hosts Dependencies

Posted: Thu Nov 26, 2015 4:15 am
by gpi
Hello,

We have been working on configuring several Hosts dependencies in our infraestructure, but seems not to be working properly, or as we expected to be.

This is our currently set up for a Host dependency:
Dependencies.png
And in order to check if the configurtation of all the dependencies had been configured properly, we forced HOST A to be unreachable, so all other hosts shouldn't be appearing as Unhandled hosts, right?
As soon as HOST A becomes unreachable, we get the following:
Operations 1.png
But what we really want is to happen the following:
Operations 2.png
How we need to configure the Host Dependency in order to prevent all the Host appering on the Operations Screen as Unhandled Hosts Problems?

Thanks in advance and best regards,

J.

Re: Configuring Nagios Hosts Dependencies

Posted: Thu Nov 26, 2015 7:45 pm
by Box293
What version of Nagios XI are you using?

Can you go into CCM and for the host dependency please click the disk icon and paste the text config here.

Re: Configuring Nagios Hosts Dependencies

Posted: Tue Dec 01, 2015 3:34 am
by gpi
Hi there Box,

Thanks for your reply. Please, find hereunder the Host Dependencies.

Code: Select all

###############################################################################
#
# Host dependency configuration file
#
# Created by: Nagios Core Config Manager 2.5.1
# Date:	      2015-12-01 17:32:25
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define hostdependency {
	#	config_name	Dependencias_VPN_BCA
		dependent_host_name           		bca1.bca.intranet,bca2.bca.intranet
		host_name                     		VPN_BCA
		inherits_parent               		1
		execution_failure_criteria    		n,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

define hostdependency {
	#	config_name	Dependencias_VPN_BCL
		dependent_host_name           		bd_bclh
		host_name                     		VPN_BCL
		inherits_parent               		1
		execution_failure_criteria    		n,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

define hostdependency {
	#	config_name	Dependencias_VPN_BJA
		dependent_host_name           		bja1.bja.intranet,bja2.bja.intranet
		host_name                     		VPN_BJA
		inherits_parent               		1
		execution_failure_criteria    		n,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

define hostdependency {
	#	config_name	Dependencias_VPN_BPC
		dependent_host_name           		bd_pcgp,bd_rdo,bpc1.bpc.intranet,bpc2.bpc.intranet
		host_name                     		VPN_BPC
		inherits_parent               		0
		execution_failure_criteria    		u,d,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

define hostdependency {
	#	config_name	Dependencias_VPN_BPO
		dependent_host_name           		bd_bpo,bpo1.bpo.intranet,bpo2.bpo.intranet
		host_name                     		VPN_BPO
		inherits_parent               		1
		execution_failure_criteria    		n,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

define hostdependency {
	#	config_name	Dependencias_VPN_BPRO
		dependent_host_name           		bd_bpro
		host_name                     		VPN_BPRO
		inherits_parent               		1
		execution_failure_criteria    		n,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

define hostdependency {
	#	config_name	Dependencias_VPN_BPSJ
		dependent_host_name           		bd_bpsj,bpsj1.bpsj.intranet,bpsj2.bpsj.intranet
		host_name                     		VPN_BPSJ
		inherits_parent               		1
		execution_failure_criteria    		n,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

define hostdependency {
	#	config_name	Dependencias_VPN_BSF
		dependent_host_name           		bd_bsf,bsf.bsf.intranet
		host_name                     		VPN_BSF
		inherits_parent               		1
		execution_failure_criteria    		n,
		notification_failure_criteria 		u,d,
		dependency_period             		24x7
}	

###############################################################################
#
# Host dependency configuration file
#
# END OF FILE
#
###############################################################################
Just for more information and taking an example

For this Host: VPN_BPSJ (which is a monitorized VPN), if drops, the following hosts (bd_bpsj,bpsj1.bpsj.intranet,bpsj2.bpsj.intranet) shouldn't be neither notified nor shown in the Undhandled Host problems screen.

This is the definied Host Dependency for the taken example:

Code: Select all

define hostdependency {
   #   config_name   Dependencias_VPN_BPSJ
      dependent_host_name                 bd_bpsj,bpsj1.bpsj.intranet,bpsj2.bpsj.intranet
      host_name                           VPN_BPSJ
      inherits_parent                     1
      execution_failure_criteria          n,
      notification_failure_criteria       u,d,
      dependency_period                   24x7
}

Regards,

J.

Re: Configuring Nagios Hosts Dependencies

Posted: Tue Dec 01, 2015 5:48 pm
by tmcdonald
That example will only stop notifications - the dependent hosts will still be checked. From the documentation regarding execution_failure_criteria:
If you specify n (none) as an option, the execution dependency will never fail and the dependent host will always be actively checked

Re: Configuring Nagios Hosts Dependencies

Posted: Wed Dec 02, 2015 9:39 am
by jacek
That's interesting, what is the default, expected behaviour (d,u?)?
How do I change that (so the database doesn't overwrite that)?

Re: Configuring Nagios Hosts Dependencies

Posted: Wed Dec 02, 2015 4:52 pm
by lmiltchev
You can select whatever "Execution failure criteria" option you need in the CCM (under the "Host Dependency Management). Save and apply configuration.

Here's our documentation on the execution failure criteria options:
Hostdependency - execution failure criteria

This directive is used to specify the criteria that determine when the dependent host should not be actively checked. If the master host is in one of the failure states we specify, the dependent host will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas):
o = fail on an UP state,
d = fail on a DOWN state,
u = fail on an UNREACHABLE state, and
p = fail on a pending state (e.g. the host has not yet been checked).

If you specify n (none) as an option, the execution dependency will never fail and the dependent host will always be actively checked (if other conditions allow for it to be).

Example: If you specify u,d in this field, the dependent host will not be actively checked if the master host is in either an UNREACHABLE or DOWN state.

Parameter name: execution_failure_criteria
Required: no
Hope this helps.

Re: Configuring Nagios Hosts Dependencies

Posted: Thu Dec 03, 2015 7:11 am
by jacek
My host dependencies are empty.
Thus I have ~100 hosts which all have their parents set.

So how does this affect the child-parents relations?
Or is this something completely else?

Re: Configuring Nagios Hosts Dependencies

Posted: Thu Dec 03, 2015 6:04 pm
by ssax
I apologize, can your explain a bit more on what you mean when you say your host dependencies are empty?

When you have a parent/child relationship the children will become unknown but still perform the checks, it just won't notify if you don't have unknown/unreachable notifications enabled.

With dependencies you have the ability to have it not check/not notify.

Thank you

Re: Configuring Nagios Hosts Dependencies

Posted: Fri Dec 04, 2015 2:09 am
by jacek
So what You mean is that the host/child relationship is something separate to the dependencies, right?

Re: Configuring Nagios Hosts Dependencies

Posted: Fri Dec 04, 2015 3:29 pm
by ssax
Correct.