What are people experiance with Labels and Tags in CheckMK 2.0+?

Currently I’m checking out the labels and tags option within CheckMK 2.0p16. For what I can see is tags useful if you give settings on host level. Labels seems to be more rules oriented. Where you can add host/service labels based on a rule.
I don’t have the best administration for host settings and I don’t like to configure tags based on folder of hosts. So labels seem to be the way to go.

What is your preferred choice and how did you use tags/labels in your CheckMK?

Links to docs:
host tags Rules
labels Labels

Links to same topic

To me a label is an intrinsic attribute (host is a “label”) where a tag is more of a grouping/relationship identifier (these hosts/services are “tag”)

But, there’s lots of semantics where the implementation is totally up to you.

CM wise, we put labels in the spool area for pickup on first scan into CheckMk. Thus, for us, the intrinsic attributes can come from our CM system (we use Ansible). But I use rules to assign to groups in Checkmk. But I used the labels for auto configuring certain things, just like they are used for VMware stuff (for example). In one of our cases, we trigger on whether or not a host is a rabbitmq server (for example). We did create a customer tag (drop down selector) for our “environments”, so that on add, we manually select what environment that way (e.g. dev, test, prod, infrastructure).

- include_tasks: "tasks/create_checkmk_label_t.yaml"
  vars:
    name:   "os_type"
    value:  "linux"
- include_tasks: "tasks/create_checkmk_label_t.yaml"
  vars:
    name:   "rabbitmq"
    value:  "true"
  when:
    "'g_rabbitmq' in group_names"

Also found youtube video from checkmk about is :slight_smile: Episode 7 (Part 2): Smart rules with Host Tags in Checkmk - YouTube

Anyhow, agree that there a lots of semantics. I have seen that the Vmware plugin will place labels like ESX and not tags. So this is sort auto configuring mechanism.

Agree on the drop down part, that is something label doesn’t have at the moment.

I for myself define it like this
Tag → static and predefined
Label → dynamic and defined at runtime
In the end booth can do the same.

Do you set both manually of with automation tool?

Tags as they are predefined also mostly inherited from folders (location or typ).
Labels are set at host creation time with automation scripts or set from services.
Also i use the data-2-label or data-2-tag from @r.sander then the labels/tags come from HW/SW inventory data.

IMHO labels should not be used by setting them manually in the host properties. Labels should always be set automatically, by auto discovery or at least with the rulesets “Host labels” and “Service labels”.

In the end labels are just free text fields and the danger of getting inconsistencies is too high.

2 Likes

The tags are very easy to use for grouping, filtering and in the rule conditions. Also the grouping of tags (auxiliary tags) is a plus point. The disadvantage is that they have to be predefined.

The labels offer more flexibility because they do not have to be predefined. But you can’t properly manage service labels and they are error prone (typos) when creating and using them as filter or condition.

Unfortunately the possibility to use the service tags in Rule conditions is still not available. And with the labels you can only specify one value per label as a condition. Multiple values (if label=a or label=b) or a regex cannot be selected in the filters and conditions.

That is great that you point the disadvantage out. Because can imagion that people make error and the multiple values can be a most something. Hopefully this will be something for the future version of CheckMK 2.x.
Because I can image that based on hostname of IP, checkmk doesn’t know what kind of machine it is. Setting/managing tags can be an task it self to manage. There for label for OS or other ‘facts’ would be really helpful. For now we can automate the ‘type of host’ as a tags. But things as major OS or other things, will set when labels have more features. Even if labels can be set based on mk_inventory for example.

There is an extension available that does exactly that: check_mk_extensions/data2label at cmk2.0 · HeinleinSupport/check_mk_extensions · GitHub

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.