Module: check_mk
Branch: master
Commit: 26678569925e26edcd3d9abb4e2d9028822548f4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26678569925e26…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Oct 16 16:24:22 2018 +0200
Status data inventory is ignored for Check_MK clusters
Change-Id: Ib351b9a639c49d04e4beb1f701ac21d4628c38f1
---
.werks/6736 | 16 ++++++++++++++++
cmk_base/inventory.py | 5 ++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/6736 b/.werks/6736
new file mode 100644
index 0000000..6d2493c
--- /dev/null
+++ b/.werks/6736
@@ -0,0 +1,16 @@
+Title: Status data inventory is ignored for Check_MK clusters
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1538487393
+
+Status data inventory is not executed for Check_MK clusters
+because they do not have own data sources for which status data
+inventory is reasonable.
+If status data inventory should be done for the related nodes
+then you enable {{Status data inventory}} wihtin the ruleset
+{{Do hardware/software Inventory}} for these nodes.
diff --git a/cmk_base/inventory.py b/cmk_base/inventory.py
index 1a70030..3ffdaca 100644
--- a/cmk_base/inventory.py
+++ b/cmk_base/inventory.py
@@ -152,8 +152,10 @@ def do_inv_check(hostname, options):
def do_status_data_inventory(sources, multi_host_sections, hostname, ipaddress):
- import cmk_base.inventory_plugins as inventory_plugins
+ if config.is_cluster(hostname):
+ return
# cmk_base/modes/check_mk.py loads check plugins but not inventory plugins
+ import cmk_base.inventory_plugins as inventory_plugins
do_inv = False
section_names = multi_host_sections.get_host_sections().get((hostname,
ipaddress)).sections.keys()
inventory_plugins.load_plugins(check_api.get_check_api_context,
get_inventory_context)
@@ -337,6 +339,7 @@ def _save_inventory_tree(hostname, inventory_tree):
filepath = _inventory_output_dir + "/" + hostname
if inventory_tree:
old_tree = StructuredDataTree().load_from(filepath)
+ old_tree.normalize_nodes()
if old_tree.is_equal(inventory_tree):
console.verbose("Inventory was unchanged\n")
else: