Hi there,

I was trying to setup a convenient way to create dependencies on one (clustered) host to its peer (also a cluster of two nodes). The config looks more or less like this:

object Host "vpn-gw-a" {
  import "netscreen-template"
  address = "1.2.3.4"
  vars.nsvpn["Remote location"] = {
    tunnel = "tunnel-name"
    peer = [ "vpn-gw-b-1", "vpn-gw-b-2" ]
  }
}

What I tried was the following, but - of course - this only adds the last peer of the peer-Array from above to the dependency.

# VPN Tunnel dependency to other clusters (peer = Array)
apply Dependency for (nsvpn => config in host.vars.nsvpn) to Host {
  child_host_name = host.name
  child_service_name = "VPN Tunnel " + nsvpn
  for (peer in config.peer) {
    parent_host_name = peer
  }
  disable_notifications = true
  disable_checks = true
  assign where typeof(config.peer) == typeof([])
}

Any idea how to solve this in a smart way?

Many thanks,
Stephan
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to