Module: check_mk
Branch: master
Commit: 50d1b9e49303416fef34d58aef1ecc85e1b7c0ab
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50d1b9e4930341…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 29 09:42:16 2011 +0100
Hostmatrix: limit to 900 hosts
---
web/plugins/sidebar/shipped.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index e658a45..b51e3f8 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -274,10 +274,16 @@ sidebar_snapins["problem_hosts"] = {
# --------------------------------------------------------------
def render_hostmatrix():
html.live.set_prepend_site(True)
- query = "GET hosts\nColumns: name state has_been_checked worst_service_state
scheduled_downtime_depth\nFilter: custom_variable_names < _REALNAME\n"
+ query = "GET hosts\n" \
+ "Columns: name state has_been_checked worst_service_state
scheduled_downtime_depth\n" \
+ "Filter: custom_variable_names < _REALNAME\n" \
+ "Limit: 901\n"
hosts = html.live.query(query)
html.live.set_prepend_site(False)
hosts.sort()
+ if len(hosts) > 900:
+ html.write(_("Sorry, I will not display more than 900 hosts."))
+ return
# Choose smallest square number large enough
# to show all hosts