Module: check_mk
Branch: master
Commit: 33cf88df3c7e2b11aba648ab7bd88739536dc74a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33cf88df3c7e2b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 2 08:35:33 2017 +0200
5217 FIX BI: Improved error handling in case of not existing but referenced rule
The error handling has been improved for the situation where an aggregation
references a not existing BI rule.
Change-Id: I1e3978fd559c65dc32ba0d97a898d885a2cf595e
---
.werks/5217 | 12 ++++++++++++
web/plugins/wato/bi.py | 7 +++++++
2 files changed, 19 insertions(+)
diff --git a/.werks/5217 b/.werks/5217
new file mode 100644
index 0000000..10cddb8
--- /dev/null
+++ b/.werks/5217
@@ -0,0 +1,12 @@
+Title: BI: Improved error handling in case of not existing but referenced rule
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1506926056
+
+The error handling has been improved for the situation where an aggregation
+references a not existing BI rule.
diff --git a/web/plugins/wato/bi.py b/web/plugins/wato/bi.py
index ad907a9..e2e046b 100644
--- a/web/plugins/wato/bi.py
+++ b/web/plugins/wato/bi.py
@@ -1066,6 +1066,9 @@ class ModeBIAggregations(ModeBI):
def render_aggregation_rule_tree(self, aggregation):
toplevel_rule = self.aggregation_toplevel_rule(aggregation)
+ if not toplevel_rule:
+ html.show_error(_("The top level rule does not exist."))
+ return
self.render_rule_tree(toplevel_rule["id"], toplevel_rule["id"])
@@ -1318,9 +1321,13 @@ class ModeBIRules(ModeBI):
def _aggregation_recursive_sub_rule_ids(self, ruleid):
rule = self.find_rule_by_id(ruleid)
+ if not rule:
+ return []
+
sub_rule_ids = self.aggregation_sub_rule_ids(rule)
if not sub_rule_ids:
return []
+
result = sub_rule_ids[:]
for sub_rule_id in sub_rule_ids:
result += self._aggregation_recursive_sub_rule_ids(sub_rule_id)
Module: check_mk
Branch: master
Commit: 6c1b337636939fe56bef397e929aaa85ecd41958
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6c1b337636939f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 2 11:58:09 2017 +0200
5358 FIX Event console status queries now handle the Limit header correctly
The event console status queries (e.g. used to show data in the GUI) were
ignoring the Limit header which caused the EC to process too many rows
in the response to status queries.
Change-Id: I2eb6ac6c62b8f240e3df053741bb654ade28393c
---
.werks/5358 | 12 ++++++++++++
bin/mkeventd | 5 +++++
2 files changed, 17 insertions(+)
diff --git a/.werks/5358 b/.werks/5358
new file mode 100644
index 0000000..dc2a26d
--- /dev/null
+++ b/.werks/5358
@@ -0,0 +1,12 @@
+Title: Event console status queries now handle the Limit header correctly
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1506938154
+Class: fix
+
+The event console status queries (e.g. used to show data in the GUI) were
+ignoring the Limit header which caused the EC to process too many rows
+in the response to status queries.
diff --git a/bin/mkeventd b/bin/mkeventd
index 565adac..c8dcd12 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -3300,7 +3300,11 @@ class StatusTable(object):
# TODO: Add support for ColumnHeaders like in livestatus?
yield query.requested_columns
+ num_rows = 0
for row in self._enumerate(query):
+ if query.limit is not None and num_rows >= query.limit:
+ break # The maximum number of rows has been reached
+
# Apply filters
# TODO: History filtering is done in history load code. Check for improvements
if query.filters and query.table_name != "history":
@@ -3309,6 +3313,7 @@ class StatusTable(object):
continue
yield self._build_result_row(row, requested_column_indexes)
+ num_rows += 1
# Must return a enumerable type containing fully populated lists (rows) matching the