[icinga-users] multiple child dependencies with same parent

Václav Mach machv at cesnet.cz
Tue Jul 3 14:13:45 CEST 2018


Hello,

i am trying to setup service dependecies. My configuration is:

apply Dependency "visitor_realms_home_servers" for (server in
service.vars.home_server) to Service {
    parent_host_name = server
    parent_service_name = service.vars.visitors_realm + "@" +
service.vars.visitors_realm
    disable_checks = true
    assign where service.vars.home_realm_check == "0"
}

Dependecies are created correctly but i guess i want to achieve
something that is not currently possible.

Created dependencies look like this:

Object
'radius.fit.cvut.cz!akademie-hotelnictvi.cz at fit.cvut.cz!visitor_realms_home_serversradius.akademie-hotelnictvi.cz'
of type 'Dependency':
  % declared in '/etc/icinga2/conf.d/dependencies.conf', lines 43:1-43:98
  * __name =
"radius.fit.cvut.cz!akademie-hotelnictvi.cz at fit.cvut.cz!visitor_realms_home_serversradius.akademie-hotelnictvi.cz"
  * child_host_name = "radius.fit.cvut.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * child_service_name = "akademie-hotelnictvi.cz at fit.cvut.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * disable_checks = true
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
46:5-46:25
  * disable_notifications = true
  * ignore_soft_states = true
  * name = "visitor_realms_home_serversradius.akademie-hotelnictvi.cz"
  * package = "_etc"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * parent_host_name = "radius.akademie-hotelnictvi.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
44:5-44:29
  * parent_service_name = "akademie-hotelnictvi.cz at akademie-hotelnictvi.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
45:5-45:89
  * period = ""
  * source_location
    * first_column = 1
    * first_line = 43
    * last_column = 98
    * last_line = 43
    * path = "/etc/icinga2/conf.d/dependencies.conf"
  * states = null
  * templates = [
"visitor_realms_home_serversradius.akademie-hotelnictvi.cz" ]
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * type = "Dependency"
  * vars = null
  * zone = "ermon2.cesnet.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98

This one is fine, because the domain "fit.cvut.cz" has only one host
associated with it. The problem appears when there are more hosts
associated with the domain:

 Object
'radius1.asu.cas.cz!akademie-hotelnictvi.cz at asu.cas.cz!visitor_realms_home_serversradius.akademie-hotelnictvi.cz'
of type 'Dependency':
   % declared in '/etc/icinga2/conf.d/dependencies.conf', lines 43:1-43:98
   * __name =
"radius1.asu.cas.cz!akademie-hotelnictvi.cz at asu.cas.cz!visitor_realms_home_serversradius.akademie-hotelnictvi.cz"
   * child_host_name = "radius1.asu.cas.cz"
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
   * child_service_name = "akademie-hotelnictvi.cz at asu.cas.cz"
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
   * disable_checks = true
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
46:5-46:25
   * disable_notifications = true
   * ignore_soft_states = true
   * name = "visitor_realms_home_serversradius.akademie-hotelnictvi.cz"
   * package = "_etc"
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
   * parent_host_name = "radius.akademie-hotelnictvi.cz"
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
44:5-44:29
   * parent_service_name = "akademie-hotelnictvi.cz at akademie-hotelnictvi.cz"
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
45:5-45:89
   * period = ""
   * source_location
     * first_column = 1
     * first_line = 43
     * last_column = 98
     * last_line = 43
     * path = "/etc/icinga2/conf.d/dependencies.conf"
   * states = null
   * templates = [
"visitor_realms_home_serversradius.akademie-hotelnictvi.cz" ]
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
   * type = "Dependency"
   * vars = null
   * zone = "ermon2.cesnet.cz"
     % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98



Object
'radius2.asu.cas.cz!akademie-hotelnictvi.cz at asu.cas.cz!visitor_realms_home_serversradius.akademie-hotelnictvi.cz'
of type 'Dependency':
  % declared in '/etc/icinga2/conf.d/dependencies.conf', lines 43:1-43:98
  * __name =
"radius2.asu.cas.cz!akademie-hotelnictvi.cz at asu.cas.cz!visitor_realms_home_serversradius.akademie-hotelnictvi.cz"
  * child_host_name = "radius2.asu.cas.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * child_service_name = "akademie-hotelnictvi.cz at asu.cas.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * disable_checks = true
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
46:5-46:25
  * disable_notifications = true
  * ignore_soft_states = true
  * name = "visitor_realms_home_serversradius.akademie-hotelnictvi.cz"
  * package = "_etc"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * parent_host_name = "radius.akademie-hotelnictvi.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
44:5-44:29
  * parent_service_name = "akademie-hotelnictvi.cz at akademie-hotelnictvi.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
45:5-45:89
  * period = ""
  * source_location
    * first_column = 1
    * first_line = 43
    * last_column = 98
    * last_line = 43
    * path = "/etc/icinga2/conf.d/dependencies.conf"
  * states = null
  * templates = [
"visitor_realms_home_serversradius.akademie-hotelnictvi.cz" ]
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98
  * type = "Dependency"
  * vars = null
  * zone = "ermon2.cesnet.cz"
    % = modified in '/etc/icinga2/conf.d/dependencies.conf', lines
43:1-43:98


Could i somehow relate these two (or more dependending on number of
hosts)? Could i specify when the dependency should be applied - for
example when both (all) services are down or when only one is down?
I've found
https://monitoring-portal.org/t/multiple-host-dependencies/1683/7 and
https://github.com/Icinga/icinga2/issues/1869
Both these topics seem to me that they are highly related to my problem,
but not exacly what i'm trying to solve.

Could someone please clarify is some conditions (and/or) are possible
with this configuration? In case it is not possible, workaround
suggestions are welcome.

What is the current behavior when evaluating if the dependency is
applied or not with this configuration?

Thanks for help,
Vaclav
-- 
Václav Mach
tel: +420 234 680 206
CESNET, z.s.p.o.
www.cesnet.cz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3710 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.icinga.org/pipermail/icinga-users/attachments/20180703/427508c1/attachment.bin>


More information about the icinga-users mailing list