Module: check_mk
Branch: master
Commit: 4a9e0423430429b88780d00d013f6fca006e5b71
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a9e0423430429…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Aug 6 15:15:56 2012 +0200
Added helper function for custom host var painters
---
web/plugins/views/painters.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index c789e38..9bce496 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -103,6 +103,16 @@ multisite_painter_options["ts_date"] = {
("%m/%d", "12/18") ]
}
+# This helper function returns the value of the given custom var
+def paint_custom_host_var(what, row):
+ custom_vars = dict(zip(row["host_custom_variable_names"],
+ row["host_custom_variable_values"]))
+
+ if what in custom_vars:
+ return what, custom_vars[what]
+ return what, ""
+
+
# ___
# |_ _|___ ___ _ __ ___
# | |/ __/ _ \| '_ \/ __|
@@ -145,7 +155,6 @@ def paint_icons(what, row):
return "icons", output
-
def iconpainter_columns(what):
cols = set(['site',
'host_name',