How to create service group for service from a particular Host group

Hi All,

I’m trying to create a Service Group for a Disk in a particular host group and I tried some possibilities and have not found any solution for it. please help to create a service group for Disk from a Host group.

Hi,
you can simply create service groups with the apply rules, e.g. Language Reference - Icinga 2

Hi Marcus Caepio,

Thanks for your response, I tried it but got the error when specifying the hostgroup
i need to group all disk services under one service group from a Hostgroup

object ServiceGroup "Disk Client " {
display_name = “Disk Client”
assign where match(“Disk Utilization*”, service.name) && assign where “Client-servers” in host.groups

}

I don’t thinks that’s how it works.
I use one assign where / ignore where per line without && or ||.
Have a try with:

object ServiceGroup "Disk Client " {
  display_name = “Disk Client”
  assign where match(“Disk Utilization*”, service.name)
  ignore where “Client-servers” !in host.groups
}

or

object ServiceGroup "Disk Client " {
  display_name = “Disk Client”
  assign where match(“Disk Utilization*”, service.name) && “Client-servers” in host.groups
}

Hi Dominik,

Thank you so much for your support. below mentioned is perfectly worked for me

object ServiceGroup "Disk Client " {
display_name = “Disk Client”
assign where match(“Disk Utilization*”, service.name) && “Client-servers” in host.groups
}