Allow Multiple Label Values per Key for a Host

With multiple values the rulesets “Service Label” and “Host Label” would not work any more.

We are currently assigning labels with these two rulesets in the form “sla:silver”, “sla:gold” and “sla:platinum” to hosts and services.

The rulesets itself have a match type “all”, i.e. all matching rules add to the resulting list. With the exception that labels with the same key will be set on first occurance.

Otherwise we could no assign a label “sla:platinum” to a specific service on a “silver” host where all other services should get “sla:silver” with the host tag as condition.

Example:

rule1: condition: service name = “Interface eth0” value: label = “sla:platinum”
rule2: condition: host tag = “sla:silver” value: label = “sla:silver”

With your idea of multiple values this service would then get “sla:platinum” and “sla:silver” assigned.

How would you solve our use case?

2 Likes