Question to filter monitoring object

Hi All,
if I have an Host object array variable called “vars.team” ( vars.team += [ “AB”, “EF” ] etc. += because I work with imported templates), where different teams can be assigned to see a server in icingaweb2, do I still have to filter with
monitoring/filter/objects = "_host_team=*teamname*|_service_team=*teamname*" ???
It’s a long time ago, where (I think) @elippmann or @dnsmichi gave me this tip.
Because I now have the problem, that I have teamnames like “AB” and Subteams like"AB-CD".
When I create a role, where I filter like
monitoring/filter/objects = "_host_team=*AB*|_service_team=*AB*"
The AB team could also see the “AB-CD” team, right? But that should not be :slight_smile:
Did anything change here in the past?

Cheers,
Marcus

Hi Marcus,

If a custom variable is an array or a dict, the JSON representation of the variable is stored in the database. That makes filters ugly and slow. Still we may solve your problem. In your example ["AB","EF"]is saved in the database for the teams variable. You may use _host_team=*"AB"* in your restriction to only allow AB but not AB-CD. We just added the quotes around AB here to support that.

Does this help?

Best,
Eric

1 Like

Hi Eric,
Thanks a lot. Will try it on Monday.
But if this is slow and ugly, do you have a better practice for me?

Have a nice weekend!
Best,
Marcus