Module: check_mk
Branch: master
Commit: ffe1fba642c328499ecc22050ba7e50b0912e1d0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ffe1fba642c328…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue May 1 19:20:24 2018 +0200
Fixed status data inventory execution
Change-Id: I9ba097d913ae15f37bb480edd2a2569a8f125933
---
cmk_base/checks.py | 4 +---
cmk_base/inventory.py | 3 ++-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/cmk_base/checks.py b/cmk_base/checks.py
index 9014148..5be485c 100644
--- a/cmk_base/checks.py
+++ b/cmk_base/checks.py
@@ -720,9 +720,7 @@ def do_status_data_inventory_for(hostname):
# use it after every check cycle.
params = rulesets.host_extra_conf(hostname, rules)
if params:
- # Means: Enabled "Do hardware/software inventory",
- # => params is at least [{}]
- return params[0].get('status_data_inventory', True)
+ return params[0].get('status_data_inventory', False)
return False
diff --git a/cmk_base/inventory.py b/cmk_base/inventory.py
index dd57b4f..89dbcb0 100644
--- a/cmk_base/inventory.py
+++ b/cmk_base/inventory.py
@@ -173,7 +173,8 @@ def do_inv_for(sources, hostname, ipaddress):
console.section_success("Found %s%s%d%s inventory entries" %
(tty.bold, tty.yellow, inventory_tree.count_entries(), tty.normal))
- if not status_data_tree.is_empty():
+ if not status_data_tree.is_empty() \
+ and checks.do_status_data_inventory_for(hostname):
status_data_tree.normalize_nodes()
_save_status_data_tree(hostname, status_data_tree)