Module: check_mk
Branch: master
Commit: 53aa3c737218d10e3f3cab9ba43527ec8be9f54e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=53aa3c737218d1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Apr 29 22:28:51 2012 +0200
WATO: make host names in column parents clickable
---
web/plugins/wato/builtin_attributes.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/web/plugins/wato/builtin_attributes.py
b/web/plugins/wato/builtin_attributes.py
index 3f8311f..a310fdc 100644
--- a/web/plugins/wato/builtin_attributes.py
+++ b/web/plugins/wato/builtin_attributes.py
@@ -60,6 +60,7 @@ class ParentsAttribute(ValueSpecAttribute):
"manually.<br><br>In a distributed setup make sure
that the host and all "
"of its parents are monitored by the same site."),
orientation = "horizontal"))
+
def to_nagios(self, value):
if value:
return ",".join(value)
@@ -67,6 +68,12 @@ class ParentsAttribute(ValueSpecAttribute):
def nagios_name(self):
return "parents"
+ def paint(self, value, hostname):
+ parts = [ '<a href="%s">%s</a>' % (
+ "wato.py?" + htmllib.urlencode_vars([("mode",
"edithost"), ("host", hn)]), hn)
+ for hn in value ]
+ return "", ", ".join(parts)
+
declare_host_attribute(ParentsAttribute(),
show_in_table = True,