More checks for a special hostgroup


#1

Hi,

is it possible to set more service max_check_attempts for a specific hostgroup without writting a new service object?

I can’t find a good solution for this problem.

best regards

zlFamous


(Michael Friedrich) #2

With a condition inside the apply rules, this should be doable.

apply Service "..." {
  ...

  if ("more_check_attempts" in host.groups) {
    max_check_attempts = 10
  } else {
    max_check_attempts = 5
  }

 ...
}

References:
https://www.icinga.com/docs/icinga2/latest/doc/17-language-reference/#operators
https://www.icinga.com/docs/icinga2/latest/doc/17-language-reference/#conditional-statements


#3

Thank you Michael, it works.