I'm trying to turn off the http check for one host in my icinga2 setup. I'm new to this and am just going around in circles.
I'm using the standard install and have it successfully running against a number of linux sattelite machienes happily, but a few don't have web servers running on them so I want to turn off the http check.
Following some inconclusive looking around I came across Avoiding Common Pitfalls with Apply Rules which seem to do what I want with the vars.no_web_check variable, but try as I might I can't get it to work.
I've added the ignore line to groups.conf for the http test, but when I set up my host config in repository.d/hosts/ as follows
object Host "kvm3.infoteq.com.au" {
import "satellite-host"
check_command = "cluster-zone"
vars.no_web_check = true
}
}
I get an error when I try and reload icinga2 saying there is a problem with this config, Error: Value computed is not used.
The modified http stanza from groups.conf file is
object ServiceGroup "http" {
display_name = "HTTP Checks"
assign where match("http*", service.check_command)
ignore where host.vars.no_web_check
}
Is this where I should be adding this check? There must be an easier way to do this.
Best Answer
For your service, I would try to use a service declaration and not a servicegroup, for example :
This service is applied to all hosts where their names are in the
assign
declaration.You can use
ignore
to exclude some hosts. It's the syntax ofassign
.