link to host page)" to show all
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: d2a945da5416c46b2e457569da3a3950407106ae
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d2a945da5416c4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 27 09:52:52 2012 +0200
BI: Added new painter "affected hosts (link to host page)" to show all
host names with links to the "hosts" view
---
ChangeLog | 2 ++
web/plugins/views/bi.py | 12 +++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 25022ac..2f98daa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
Multisite
* Added config option default_ts_format to configure default timestamp
output format in multisite
+ * BI: Added new painter "affected hosts (link to host page)" to show all
+ host names with links to the "hosts" view
* FIX: Fixed encoding problem in "custom notification" message
Checks & Agents:
diff --git a/web/plugins/views/bi.py b/web/plugins/views/bi.py
index 8190e6f..5c8c09f 100644
--- a/web/plugins/views/bi.py
+++ b/web/plugins/views/bi.py
@@ -117,10 +117,10 @@ multisite_painters["aggr_output"] = {
"paint" : lambda row: ("", row["aggr_output"])
}
-def paint_aggr_hosts(row):
+def paint_aggr_hosts(row, link_to_view):
h = []
for site, host in row["aggr_hosts"]:
- url = html.makeuri([("view_name", "aggr_host"),
("site", site), ("host", host)])
+ url = html.makeuri([("view_name", link_to_view), ("site",
site), ("host", host)])
h.append('<a href="%s">%s</a>' % (url, host))
return "", " ".join(h)
@@ -128,9 +128,15 @@ multisite_painters["aggr_hosts"] = {
"title" : _("Aggregation: affected hosts"),
"short" : _("Hosts"),
"columns" : [ "aggr_hosts" ],
- "paint" : paint_aggr_hosts,
+ "paint" : lambda row: paint_aggr_hosts(row, "aggr_host"),
}
+multisite_painters["aggr_hosts_services"] = {
+ "title" : _("Aggregation: affected hosts (link to host
page)"),
+ "short" : _("Hosts"),
+ "columns" : [ "aggr_hosts" ],
+ "paint" : lambda row: paint_aggr_hosts(row, "host"),
+}
multisite_painter_options["aggr_expand"] = {
"title" : _("Initial expansion of aggregations"),