[2020-03-20 10:46:54 +0100] critical/config: Error: Error while evaluating expression: Tried to access undefined script variable ‘service’
Location: in /data/app/icinga2/objects.d/services/server/xen-services.conf: 55:16-55:22
/data/app/icinga2/objects.d/services/server/xen-services.conf(53): #ignore where “Local Storage” in host.vars.disabled_checks
/data/app/icinga2/objects.d/services/server/xen-services.conf(54): #ignore where this.name in host.vars.disabled_checks
/data/app/icinga2/objects.d/services/server/xen-services.conf(55): ignore where service.name in host.vars.disabled_checks
I have started the debugger (icinga2 daemon -C -X) and looked into it.
It seems, that I can’t access the variables from the service object I want to apply. I think, this is because the assign/ignore rule using another scope.
If I’m writing the service.name to globals, I can access the name within the assign/ignore rule. But this solution isn’t very pretty
globals.my_service_name = this.name
ignore where globals.my_service_name in host.vars.disabled_checks