I want to increase max_check_attempts for one of my hosts and all its services (it is on an unstable network link, and is generating a lot of unnecessary notifications).
I managed to do this with the following configuration:
# in templates.conf
template Host "generic-host" {
max_check_attempts = 3
check_interval = 1m
retry_interval = 30s
}
template Service "generic-service" {
max_check_attempts = 5
check_interval = 1m
retry_interval = 30s
if (host.name == "host-in-question") {
max_check_attempts = 20
check_interval = 1m
retry_interval = 1m
}
}
# in other.conf
object Host "host-in-question" {
import "generic-host"
max_check_attempts = 15
check_interval = 1m
retry_interval = 1m
# unimportant configuration omitted
}
I had to add this ugly check inside generic-service
because I have lots of different Services that are created using apply
rules. But is there a cleaner way, is there a way to change max_check_attempts
for all services of some host without polluting generic-service
configuration?