Module: check_mk
Branch: master
Commit: d33c9eafd7d42bdc5b104e0a214ef162d7be3b18
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d33c9eafd7d42b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 29 11:20:01 2016 +0200
Fixed issue with "unmonitored service" view when adding own columns
---
web/plugins/views/datasources.py | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/web/plugins/views/datasources.py b/web/plugins/views/datasources.py
index 2b4c5cc..a15fb2c 100644
--- a/web/plugins/views/datasources.py
+++ b/web/plugins/views/datasources.py
@@ -250,9 +250,10 @@ def query_service_discovery(columns, query, only_sites, limit,
all_active_filter
# Hard code the discovery service filter
query += "Filter: check_command = check-mk-inventory\n"
- service_rows = do_query_data("GET services\n",
- ["host_state", "host_has_been_checked",
"long_plugin_output", "host_name"], [], [],
- query, only_sites, limit, "read")
+ if "long_plugin_output" not in columns:
+ columns.append("long_plugin_output")
+
+ service_rows = do_query_data("GET services\n", columns, [], [], query,
only_sites, limit, "read")
rows = []
for row in service_rows:
@@ -262,15 +263,13 @@ def query_service_discovery(columns, query, only_sites, limit,
all_active_filter
state, check, service_description = map(lambda s: s.strip(),
service_line.split(":", 2))
- rows.append({
- "site" : row["site"],
- "host_name" : row["host_name"],
- "host_state" : row["host_state"],
- "host_has_been_checked" :
row["host_has_been_checked"],
- "discovery_state" : state,
- "discovery_check" : check,
- "discovery_service" : service_description
+ this_row = row.copy()
+ this_row.update({
+ "discovery_state" : state,
+ "discovery_check" : check,
+ "discovery_service" : service_description
})
+ rows.append(this_row)
return rows