Module: check_mk
Branch: master
Commit: b2652c797d37bf0e6a9221553abb2266833881e4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b2652c797d37bf…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Oct 4 15:01:06 2012 +0200
BI: processing of (!!), (!) markers
---
web/plugins/views/bi.py | 2 +-
web/plugins/views/painters.py | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/web/plugins/views/bi.py b/web/plugins/views/bi.py
index 65565b2..7d2128b 100644
--- a/web/plugins/views/bi.py
+++ b/web/plugins/views/bi.py
@@ -262,7 +262,7 @@ def aggr_render_node(tree, title, mousecode, show_host):
else:
h += title
- output = effective_state["output"]
+ output = format_plugin_output(effective_state["output"])
if output:
output = "<b class=bullet>♦</b>" + output
else:
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 25ab292..93038d7 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -321,11 +321,11 @@ warn_marker = '<b class="stmark
state1">WARN</b>'
crit_marker = '<b class="stmark state2">CRIT</b>'
unknown_marker = '<b class="stmark state3">UNKN</b>'
-def format_plugin_output(row, output):
+def format_plugin_output(output, row = None):
output = output.replace("(!)", warn_marker) \
.replace("(!!)", crit_marker) \
.replace("(?)", unknown_marker)
- if "[running on" in output:
+ if row and "[running on" in output:
a = output.index("[running on")
e = output.index("]", a)
hosts = output[a+12:e].replace(" ","").split(",")
@@ -339,7 +339,7 @@ multisite_painters["svc_plugin_output"] = {
"title" : _("Output of check plugin"),
"short" : _("Status detail"),
"columns" : ["service_plugin_output"],
- "paint" : lambda row: ("", format_plugin_output(row,
row["service_plugin_output"])),
+ "paint" : lambda row: ("",
format_plugin_output(row["service_plugin_output"], row)),
"sorter" : 'svcoutput',
}
multisite_painters["svc_long_plugin_output"] = {
@@ -1573,7 +1573,7 @@ multisite_painters["log_message"] = {
def paint_log_plugin_output(row):
output = row["log_plugin_output"]
if output:
- return "", format_plugin_output(row, output)
+ return "", format_plugin_output(output, row)
else:
log_type = row["log_type"]
lst = row["log_state_type"]