Module: check_mk
Branch: master
Commit: 113fd6d31c23df777e689467692891f068ab01f7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=113fd6d31c23df…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Nov 14 13:39:36 2013 +0100
FIX display http[s] links in plugin output
---
.werks/35 | 8 ++++++++
ChangeLog | 1 +
web/htdocs/lib.py | 5 ++++-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/35 b/.werks/35
new file mode 100644
index 0000000..0b2b55e
--- /dev/null
+++ b/.werks/35
@@ -0,0 +1,8 @@
+Title: display http[s] links in plugin output
+Level: 1
+Component: multisite
+Version: 1.2.3i7
+Date: 1384432725
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index c5aa1c1..96b7217 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
* 0204 FIX: Reduced I/O on logins with access time recording or failed login
counts...
* 0206 FIX: Fixed logwatch permission check when using liveproxy...
* 0210 FIX: LDAP: Fixed problem syncing contactgroups of a user with umlauts in CN
+ * 0035 FIX: display http[s] links in plugin output
WATO:
* 0053 New rule for configuring the display_name of a service...
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 0119beb..1606408 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -24,7 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import grp, pprint, os, errno, gettext, marshal, fcntl, __builtin__
+import grp, pprint, os, errno, gettext, marshal, re, fcntl, __builtin__
#Workarround when the file is included outsite multisite
try:
@@ -255,6 +255,9 @@ def format_plugin_output(output, row = None):
css, h = paint_host_list(row["site"], hosts)
output = output[:a] + "running on " + h + output[e+1:]
+ output =
re.sub("http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
+ lambda p: '<a
href="%(group)s">%(group)s</a>' % { "group": p.group(0)
}, output)
+
return output
def format_exception():