Dynamically add cluster-zone service checks

I would like to use the cluster-zone check on my master to check if any attached zone has issues.
While i can add the service statically for every new zone attached to the master (see example below), this solution doesn’t really scale if i want to add 200+ hosts:

apply Service “agent-health” {
check_command = “cluster-zone”
display_name = “cluster-health-” + host.name
vars.cluster_zone = “somehost01.example.com
assign where host.vars.agent_endpoint == “master.example.com

Is it possible to write this service with a logic that dynamically recognizes all zones attached to the master?

You could use cluster instead or something like I have described here.

Thanks Roland, the cluster check seems to be exactly what im looking for.
For posterity:

        apply Service "cluster-health" {
          check_command = "cluster"
          display_name = "cluster-health"
          assign where host.name == "master.example.com"