Module: check_mk
Branch: master
Commit: c8cbe8456c6764ed9d149192d583a8ad37d0267d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c8cbe8456c6764…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Mar 14 13:03:57 2013 +0100
Update Manpage of mem check
---
checkman/mem.used | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/checkman/mem.used b/checkman/mem.used
index d77810e..0421ef9 100644
--- a/checkman/mem.used
+++ b/checkman/mem.used
@@ -92,5 +92,6 @@ mem_extended_perfdata (boolean): If this variable is set
to {True}, then the checks outputs additional performance
data, if the agent provides that information. On Linux
the amount of mapped and committed memory is output
- (see {Mapped} and {Committed_AS} in {/proc/meminfo}).
+ (see {Mapped} and {Committed_AS} in {/proc/meminfo}) and
+ also the size used for page tables {Pagetables}.
Module: check_mk
Branch: master
Commit: 6e1c25443e26021de1580a0e436ed8e9cdb24ab6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e1c25443e2602…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Mar 14 14:49:03 2013 +0100
FIX: speedup for single host tables joined by hostname
Conflicts:
ChangeLog
---
ChangeLog | 5 +++++
web/htdocs/bi.py | 44 ++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bb510cd..b383c3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -94,6 +94,11 @@
* Quicksearch: allow searching for complete IP addresses and IP
address prefixes
+ BI:
+ * FIX: fix exception with expansion level being 'None'
+ * FIX: speedup for single host tables joined by hostname (BI-Boxes)
+
+
1.2.2b4:
Core:
* FIX: Fix output of cmk -D: datasource programs were missing
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 74fc22d..a1c9ae2 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -1421,7 +1421,7 @@ def render_tree_foldable(row, boxes, omit_root, expansion_level, only_problems,
omit = omit_root and len(path) == 1
if not omit:
h += '<span id="%d:%s" %s class="bibox_box %s %s state state%s%s">' % (
- expansion_level, path_id, mc, leaf, is_open and "open" or "closed", effective_state["state"], addclass)
+ expansion_level or 0, path_id, mc, leaf, is_open and "open" or "closed", effective_state["state"], addclass)
if is_leaf:
h += aggr_render_leaf(tree, show_host, bare = True) # .replace(" ", " ")
else:
@@ -1705,7 +1705,10 @@ def host_table(columns, add_headers, only_sites, limit, filters):
return singlehost_table(columns, add_headers, only_sites, limit, filters, False)
def singlehost_table(columns, add_headers, only_sites, limit, filters, joinbyname):
+ log("--------------------------------------------------------------------\n")
+ log("* Starting to compute singlehost_table (joinbyname = %s)\n" % joinbyname)
load_assumptions() # user specific, always loaded
+ log("* Assumptions are loaded.\n")
# Create livestatus filter for filtering out hosts. We can
# simply use all those filters since we have a 1:n mapping between
@@ -1716,8 +1719,10 @@ def singlehost_table(columns, add_headers, only_sites, limit, filters, joinbynam
if not header.startswith("Sites:"):
filter_code += header
+ log("* Getting status information about hosts...\n")
host_columns = filter(lambda c: c.startswith("host_"), columns)
hostrows = get_status_info_filtered(filter_code, only_sites, limit, host_columns, config.bi_precompile_on_demand)
+ log("* Got %d host rows\n" % len(hostrows))
# if limit:
# views.check_limit(hostrows, limit)
@@ -1733,9 +1738,11 @@ def singlehost_table(columns, add_headers, only_sites, limit, filters, joinbynam
only_groups = [ filt.selected_group() ]
if config.bi_precompile_on_demand:
+ log("* Compiling forest on demand...\n")
compile_forest(config.user_id, only_groups = only_groups,
only_hosts = [ (h['site'], h['name']) for h in hostrows ])
else:
+ log("* Compiling forest...\n")
compile_forest(config.user_id)
# rows by site/host - needed for later cluster state gathering
@@ -1744,12 +1751,44 @@ def singlehost_table(columns, add_headers, only_sites, limit, filters, joinbynam
rows = []
# Now compute aggregations of these hosts
+ log("* Assembling host rows...\n")
+
+ # Special optimization for joinbyname
+ if joinbyname:
+ rows_by_host = {}
+ for hostrow in hostrows:
+ site = hostrow["site"]
+ host = hostrow["name"]
+ rows_by_host[(site, host)] = hostrow
+
for hostrow in hostrows:
site = hostrow["site"]
host = hostrow["name"]
+ # In case of joinbyname we deal with aggregations that bare the
+ # name of one host, but might contain states of multiple hosts.
+ # status_info cannot be filled from one row in that case. We
+ # try to optimize by assuming that all data that we need is being
+ # displayed in the same view and the information thus being present
+ # in some of the other hostrows.
if joinbyname:
+ status_info = {}
aggrs = g_user_cache["aggregations_by_hostname"].get(host, [])
- status_info = None
+ # collect all the required host of all matching aggregations
+ for a in aggrs:
+ reqhosts = a[1]["reqhosts"]
+ for sitehost in reqhosts:
+ if sitehost not in rows_by_host:
+ # This one is missing. Darn. Cancel it.
+ status_info = None
+ break
+ else:
+ row = rows_by_host[sitehost]
+ status_info[sitehost] = [
+ row["state"],
+ row["plugin_output"],
+ row["services_with_info"] ]
+ if status_info == None:
+ break
else:
aggrs = g_user_cache["host_aggregations"].get((site, host), [])
status_info = { (site, host) : [
@@ -1781,6 +1820,7 @@ def singlehost_table(columns, add_headers, only_sites, limit, filters, joinbynam
return rows
+ log("* Assembled %d rows.\n" % len(rows))
return rows