Matching labels in Agent Updater rule

CMK version: 2.1.0p14.cee
OS version: virt1, 1.5.4

I am currently setting up a distributed monitoring environment. At the moment, I have a “remote” site with the bulk of monitored hosts, and a “central” site for configuration and interactive work.

I would like to have the agents pull their updates from their corresponding site, i.e. at the moment from the remote site - which technically works as intended using a rule " Agent updater (Linux, Windows, Solaris)". I’d like to apply this rule only to hosts on the remote site, so I added as condition a match on the label “cmk/site:remote”. This does not work, the rule is not applied to the hosts on the remote site. When I add the condition “cmk/site:central” instead, the rule is applied to all hosts on the remote site. Why??? All the hosts are definitely labeled “cmk/site:remote” automatically.

Is this a bug, or has label matching in distributed environments a twist I don’t get?

Hi.

I can confirm your problem regarding this issue. Looks like, that internal labels like “cmk/site:mysite” can not use in rulesets. The question is, is there a documented limitation about this? Is there someone at tribe who can clarify this?

Christian

1 Like

@joernc you could also simply place the rule in the folder, that is associated with the site.

@ChristianM can you explain the behavior in more detail? I feel like I am missing something here. Is this problem also present in a current release?

There is no folder associated with a certain site. “location” or “site” is not part of my folder structure.

Hi,

we are currenlty running into the same issue.
We want do apply rules to all host, which are monitored on a specific Site.
The monitoring site is set explicit for each host and not by folder.

Therefor we want to use the automatically assigned label cmk/site:XYZ as condition in agent rules e.g. “Agent updater (Linux, Windows, Solaris)”. We can select the label as Condition, but the condition does not match, even if the host has the chosen label.

To reproduce the issue follow these step:

  1. You need a host that has a label “cmk/site:XYZ” (all host should have one of those)
  2. Created a Agent updater Rule which shall be used if a host does match this label - this rule will not get applied on the chosen host, but it should be.
  3. For comparison, change the condition of the rule, to be applied, if the host does not have the label assigned - in this case the rule does match but should not match

@robin.gierse can you look into this again?

Good morning,

is there any solution for this issue?
I’ve the same Problem.

We’ve 4 sites in the distributed monitoring. I don’t how i can deploy the right agent easyly.

Kind reagrds,
Pascal