Apply rules and escaping problem

  • Director version (System - About): 1.9.1
  • Icinga Web 2 version and modules (System - About): 2.9.5
  • Icinga 2 version (icinga2 --version): 2.13.2
  • Operating System and version: RHEL 8.6
  • Webserver, PHP versions: Apache 2.4.37, PHP 7.4.19

why does this not work?:
(done with Director apply rule and ‘=’ operator)

apply Service "EOL Status" {
    import "service_compliance"

    check_command = "warning_end_of_life_info"
    assign where match("*[os]_red_hat_enterprise_linux_8.5_*", host.groups)
    groups = [ "end_of_life" ]
    zone = "backend"

    import DirectorOverrideTemplate
}

it should match to all hosts there are in hostgroup “[os]_red_hat_enterprise_linux_8.5_(Ootpa)
or am I thinking wrong? Hosts are in multiple Hostgroups, is this the reason why it doesnt work?

I cant use the whole group name because if I have ‘()’ in hostgroupname I get a filter error.
It is possible to escape ‘()’ somehow?

Greetz

If I remember correctly the “in” operation is used to find if a entry is in a list/set like groups.

in produces an error with strings… AFAIK with wildcards I should use ‘=’

no one a hint how to escape the ‘()’ in hostgroup name/director?