Search for hosts based on labels

Hello everybody,

I am running Checkmk Enterprise 1.6.0p19 and having my difficulties searching hosts based on labels:

For all my Linux hosts I am setting a spool-file based label through my deployment tool

 # cat /var/lib/check_mk_agent/spool/inv_development_labels.txt
 <<<labels:sep(0)>>>
 { "os_linux" : "yes" }

I verified that label “os_linux:yes” is included in the delivered agent data for host X and WATO host status for host X shows this label as well. All fine for me.

When I do a WATO host search for hosts with labels “os_linux:yes” no host is shown to me even at least host X carries it.

We using distributed monitoring but host X is monitored by my master instance where I do the search. In my main folder (where I start the search) only sub-folders (and no hosts) are configured.

- Any ideas what goes wrong when searching for hosts with certain labels?

Thanks a lot,
Joerg

The issue was confirmed (for 1.6.0p19, 1.6.0p22, 2.0.0b7) by our partner as such and a ticket was opened for the vendor.

I consider this a rather ugly bug as distribution of local check scripts may depend on label-based agent bakery rules potentially leading to removal of such custom check scripts from agents.

Greetings,
Joerg

I don’t think this is a real bug. It is more a design problem. There are two types of labels.
First the explizit labels set inside WATO (searchable) and second the discovered labels (implizit label) not searchable inside WATO.

Hi Andreas,

thanks for your feedback on this. I understand what you are pointing to but it sounds very interesting to give such different things the same name then.

Let me please ask you for your advice with the following:

Our real issue behind my opening questing is slightly different and let me please raise it here.

In the environment I am referring to we have around 200 agents - roughly 100 windows and100 linux agents. On all 200 agents we placed one of the labels “os_win:yes”, “os_linux:yes” in spool dir to create “implicit” labels depending on the operating system we use on each host. The labels do exist for all hosts.

Based on those labels we configure our bakery to distribute custom files to agents (shell scripts to os_linux:yes, batch files to os_win:yes. And among those 200 monitored hosts there were ~80 hosts that had a “os_win:yes” or “os_linux:yes” label but received no custom files at all.

As a workaround and fallback I created a third rule that distributes both, shell and batch files to all hosts without os_win and os_linux label which is not what I want.

We use a distributed monitoring setup in this environment if that may be relvant.

Any clue on this?

Thanks a lot,
Joerg

The easiest way for this problem is a small bakery script that deploys the correct files for Windows and Linux. With such a bakery script you don’t need to know what operating system is on the machine as the agent updater gets the correct installation file and this file has only the correct scripts inside.
The bakery script for the “mk_inventory” is a good example as it builds three different versions of inventory script for the different operating systems.

1 Like

Hi Andreas,

thanks for your idea and feedback (that I’ll certainly check). We may consider upgrading to CMK2.0.0 as labels are supported there more consistently.

Greetings,
Jörg

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.