Execute service from two zones

Hello,

I am currently planing a move from one single master server to a distributed setup and have some questions about distributed checks.
Our plan is to have the following:
System A: check everything which is configured
System B: check just a subset of the configured checks (just the checks which are in a special group)

The Idea behind this is, that we have our local System A and a second system at another datacenter which is not connected to our internal network but can just check the public services. I hoped that i do not have to create seperate services like check_http_local and check_http_remove.
Would it be possible to setup something like this by just using an additional variable on the check? Like deploy all check where remote==True to System B?

Kind regards
Philipp Rehs

Hello Philipp

What you are describing is a classic examples of “zones”.
You want a zone that is your external for those checks and another for “internal” then you can define services in the global-templates zone and use the apply rules to instruct the system where to execute the checks

apply Service "users" {
  import "generic-service"

  check_command = "users"

  assign where host.zone == external
}

So this will use the service and check each host for it’s zone association and execute it in the specific zone only.

Hello Assaf,

thank you for your information. But i do not see how i can assign a service to two zones. In this example i would need two apply servuce rules for every service, right? One for the default (internal) and one for the external or?

you can have multiple assign directives in a single service

apply Service "users" {
  import "generic-service"
  check_command = "users"
  assign where host.zone == external
  assign where host.zone == internal

}
but, like i said, the service has to be defined in a global zone for this to work

Sorry, maybe my description was wrong.
I do not want to define multiple hosts with different zones.
I want to define one host which gets assigned multiple services but some of these services are checked from two zones.

Afaik this is not possible.
If you want to monitor a host/service from two perspectives you will have to create a host object for each perspective (local and external) and assign them in their respective zones to have them checked by the icinga servers of the zones.

1 Like

Yep. If you want to have a generalized view on that, decide upon Business process views, or advanced cluster checks.