Werk #14836: HW/SW Inventory: Add cluster property if the tree is not empty

Component HW/SW inventory
Title HW/SW Inventory: Add cluster property if the tree is not empty
Date Oct 12, 2022
Checkmk Edition Checkmk Raw (CRE)
Checkmk Version 2.2.0b1
Level Trivial Change
Class Bug Fix
Compatibility Incompatible - Manual interaction might be required

Previously the cluster property was added in any case even if the newly computed tree was empty (ie. no data or inventory plugins did not add any entries).

This led to a rather confusing result message of the "HW/SW Inventory" service: "Cannot update tree, Found 1 inventory entries, Got no data, ...".

In order to avoid some warnings ("Cannot update tree WARN") on trees from Checkmk <2.2 the state is OK if a tree contains only the cluster property.

Moreover there was no possibility for removing the "HW/SW Inventory" tree at all, ie. the icon "Show hardware/software inventory of this host" in the dropdown menu of the "HW/SW Inventory" stays all the time.

Now the mechanism works as follows: * Apply all related inventory plugins * Apply configured retention intervals * If the tree is not empty then set the cluster property and store the tree. * Otherwise remove the icon which means: no current inventory tree

Note: The retention intervals worked incidentally before because the tree never was empty. Thus they were always applied.

To the list of all Werks