Inter-zone dependencies

Hello Everyone,
I have a setup with master zone, satellites and endpoints. I have a web entpoint (http) in satellite zone A (website-A) and it’s working fine.
I have other 2 web sites in zone B website-A1 and website-A2) and I setup a dependency from service in website-A.
if I run the following command from icinga2 console
var t= [];for (dep in get_objects(Dependency)){ if (match("siteA*",dep.name)) { t.add(dep) };}; t;
I see the two objects created via apply rule.

If I cause a warning in site A, the other sites go warning but nofications don’t get disabled.

May you help me?

Thanks


G.S.

Hello

Can you share your dependency configuration ?
Without that it will be difficult to help .

Regards

My configuration is:

object Host "website-A" {
    display_name = "website-A"
    address = "xxx-xxx-xxx-xxxl"
    check_command = "hostalive"
    max_check_attempts = "3"
    check_interval = 10s
    retry_interval = 5s
    check_timeout = 2m
    zone = "zoneA"
    icon_image = "website.svg"
    icon_image_alt = "WebSite"
    groups = [ "web-endpoints" ]
    vars.environment = "production"
    vars.slack_notifications = "enabled"
}

object Host "website-A1" {
    display_name = "website-A1"
    address = "xxx-xxx-xxx-xxx-xxx"
    check_command = "hostalive"
    max_check_attempts = "3"
    check_interval = 10s
    retry_interval = 5s
    check_timeout = 2m
    zone = "web"
    icon_image = "website.svg"
    icon_image_alt = "WebSite"
    vars.environment = "produzione"
    vars.parent_site = "website-A1"
    vars.slack_notifications = "enabled"
}

apply Dependency "SiteA Extranet Clienti" to Service {
    parent_host = "website-A"
    parent_service = "http-endpoint"
    disable_checks = true
    disable_notifications = true
    zone = "master"
    assign where "extranet-siteA-endpoint" in service.groups
}

Hi
As you are doing the Dependency on the service, we will need to see the service definition and apply rule.

These are service configurations

template Service "http-endpoint" {
    check_command = "http"
    max_check_attempts = "3"
    check_interval = 30s
    retry_interval = 40s
    check_timeout = 2m
    command_endpoint = null
    vars.http_method = "HEAD"
    vars.http_onredirect = "critical"
    vars.http_port = "443"
    vars.http_ssl = true
    vars.http_uri = "/health"
    vars.slack_notifications = "enabled"
}

apply Service "http-endpoint" {
    import "http-endpoint"


    assign where "WebSite" in host.templates

    import DirectorOverrideTemplate
}

Ok, that helps.
Please note that the apply rule is referring to a host.template
but the host objects are not using any template to so the apply rule does not match them.

Sorry. Apply rules are working: I send you the “expanded” version of configuration.
Main problem is:
If I put the dependency in “director-global” zone, the satellites in zoneB complains that website-A does not exists (because it is in zoneA).
If I put dependency in master zone, satellites reload the configuration but dependency seems not working (but it’s applied according to icinga2 console run on master zone).

Thank you very much

You need to put them in the templates global zone, this zone is (if you defined your satellites correctly) is pushed to all the satellites and allows the definitions of object in one place and read by everyone else.