Hi,
when I install icinga from Debian stable’s packages, I get default ping services for all of my hosts:
/etc/icinga2/conf.d/services.conf:
apply Service "ping4" {
import "generic-service"
check_command = "ping4"
assign where host.address
}
I’d like to modify this service without actually modifying it. For example, for hosts in asia, I need other warning/critical thresholds. I have tried modifying ping4’s variables by establishing a host group:
object HostGroup "loc-asia" {
assign where host.vars.loc == "asia"
vars.ping_wrta = 500
vars.ping_wpl = 20
vars.ping_crta = 6000
vars.ping_cpl = 60
}
When I add vars.loc = “asia” to a host definition, i see in the web ui that the host is added to the HostGroup loc-asia. However, ping4 still uses the default thresholds.
What addiitonally confuses me is that I need to write host.vars.loc in the assign clause (“Tried to access undefined script variable ‘vars’” instead) , while I cannot write host.vars.ping_wrta in the assignments (“Attribute ‘host’ does not exist.” instead) .
Am I holding things wrong, or are the example services that come with the package really only useable for the most basic of setups?
Greetings
Marc