Hello Michi,
That sort of requires a more complex expression. While you could use the “in”
operator this would just work for exact string matches. The better approach is
to write your own global function which provides such a functionality.
A similar example with templates can be found here:
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/advanced-topics#use-functions-assign-where
globals.check_matching_hostgroup = function(host, search) {
for (hg in host.groups) {
if (match(search, hg)) {
return true
}
}
return false
}
apply Service “blub” {
//...
assign where check_matching_hostgroup(host, “*_customer")
}
Thank you very much, that will work perfectly for me!
Kind regards
Dirk
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users