Werk #17915: Fix broken central site label matching

Component User interface
Title Fix broken central site label matching
Date Apr 8, 2025
Level Trivial Change
Class Bug Fix
Compatibility Incompatible - Manual interaction might be required
Checkmk versions & editions
2.5.0b1
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.4.0b6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p31
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

Previously, agent rules that defined the "cmk/site" host label as a matching condition matched:

  1. All hosts if the condition was cmk/site:{current_site} where {current_site} is the name of the site you are currently accessing.
  2. No hosts if you specified any other cmk/site value

With this werk, we fixed an underlying bug where in the rule matching, all hosts were assigned the cmk/site:{current_site} label regardless of what site the host is being monitored on.

Hosts now properly report the site they're being monitored on as the cmk/site label value.

Note: Werk #17335 already attempted to address this problem but was ineffective.

Attention, incompatible change:

This changes which hosts are affected by agent rules matching on the cmk/site label. If you have any agent rules matching on the cmk/site host label, your agent bakery is affected:

Any agent rules matching on the cmk/site host label of the current site now no longer match hosts of ALL sites, only on hosts of the current site.

Any agent rules matching on the cmk/site host label of other sites now no longer match on hosts of the current site, only on hosts of that other site.

Example: If you are logged into your central site "central" and bake agents with an agent rule that applies to hosts with label cmk/site:remote, the rule would never have been active before this werk.

To the list of all Werks