I have a issue when creating a hostgroup of hostgroups. I have created a hostgroup “Icinga 2 Master” it has two servers. Then I created a Hostgroup “Icinga 2 Backend” which has a hostgroup included (Icinga 2 Master)
object HostGroup “hg_icinga2_backend” {
display_name = “Icinga 2 Backend”
assign where “hg_icinga2_master” in host.groups
}
After deployment, I see two servers in “Icinga 2 Master”, but “Icinga 2 Backend” stays empty. I would expect to see also two servers. It gets even more confusing, there are groups I can add, which will show up in “Icinga 2 Backend”.
Has anybody an explanation for this behavior, do I do something wrong?
BTW: I do not intend to only add one host group to the host group.
Thanks for the replay. I tried the first solution (host.name in) and it worked. But my Backend Group has been still empty. So I taged all my hosts (no, not really) and created the hostgroups with where … and now all hostgroups are empty. Since I have given my hosts multiple tags I tried “contains” insted of “=” and now it works.
Excellent!
Thanks a lot.
Cheers
cheko