Module: check_mk
Branch: master
Commit: e0f9197f488cc75d75badcfd92fd8d2f35147bc5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e0f9197f488cc7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 17 10:16:31 2014 +0100
FIX Fixed wrong count of failed hosts in bulk inventory mode
Failed inventory of hosts in bulk inventory were not counted
correctly in GUI.
---
.werks/434 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 4 ++--
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/434 b/.werks/434
new file mode 100644
index 0000000..57cb57d
--- /dev/null
+++ b/.werks/434
@@ -0,0 +1,10 @@
+Title: Fixed wrong count of failed hosts in bulk inventory mode
+Level: 1
+Component: wato
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1389949915
+
+Failed inventory of hosts in bulk inventory were not counted
+correctly in GUI.
diff --git a/ChangeLog b/ChangeLog
index 895103a..9b4175c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -184,6 +184,7 @@
* 0456 FIX: Column was too short...
* 0256 FIX: wato snapshots: snapshot restore no longer fails with older python
versions...
* 0433 FIX: Creating WATO lock during automations (like e.g. master to slave
syncs)...
+ * 0434 FIX: Fixed wrong count of failed hosts in bulk inventory mode...
Notifications:
* 0362 sms: now searching PATH for sendsms and smssend commands...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 284fab3..4bc1877 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2934,7 +2934,7 @@ def mode_bulk_inventory(phase):
arguments = [ "@scan" ] + arguments
counts, failed_hosts = check_mk_automation(site_id,
"inventory", arguments)
# sum up host individual counts to have a total count
- sum_counts = [ 0, 0, 0, 0 ]
+ sum_counts = [ 0, 0, 0, 0 ] # added, removed, kept, new
result_txt = ''
for hostname in hostnames:
sum_counts[0] += counts[hostname][0]
@@ -2957,7 +2957,7 @@ def mode_bulk_inventory(phase):
del host["inventory_failed"]
save_hosts(folder) # Could be optimized, but difficult here
- result = repr([ 'continue', num_hosts, 0 ] + sum_counts) +
"\n" + result_txt
+ result = repr([ 'continue', num_hosts, len(failed_hosts) ] +
sum_counts) + "\n" + result_txt
except Exception, e:
result = repr([ 'failed', num_hosts, num_hosts, 0, 0, 0, 0, ]) +
"\n"