Module: check_mk
Branch: master
Commit: e114a36d52814b2283175e98fa07f01b38fd0cec
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e114a36d52814b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Mar 30 18:19:42 2013 +0100
Add $SERVICEOUTPUT$ and $HOSTOUTPUT$ to allowed macros for custom notes
---
ChangeLog | 2 ++
web/.f12 | 1 -
web/plugins/views/painters.py | 7 +++++--
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3677f76..82a63b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,6 +93,8 @@
Multisite:
* FIX: fix localization in non-OMD environment
(thanks to あきら)
+ * Add $SERVICEOUTPUT$ and $HOSTOUTPUT$ to allowed macros for
+ custom notes
Notifications:
* FIX: fix event type for recoveries
diff --git a/web/.f12 b/web/.f12
index 8326daa..f8ea798 100644
--- a/web/.f12
+++ b/web/.f12
@@ -1,7 +1,6 @@
#!/bin/bash
SITE=${SITE:-$(omd sites --bare | head -n 1)}
C=$(sudo cp --preserve=mode -rv * /omd/sites/$SITE/share/check_mk/web/ | wc -l)
-#C=$(sudo cp --preserve=mode -rv htdocs/*.{css,py}
/omd/versions/default/share/check_mk/web/htdocs/ | wc -l)
echo "$C files copied"
if [ "$SITE" != - ] ; then
sudo omd restart $SITE apache
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 5e5a8de..afa2242 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -744,7 +744,10 @@ def paint_custom_notes(row):
.replace('$HOSTNAME_UPPER$', host.upper())\
.replace('$HOSTNAME_TITLE$', host[0].upper() + host[1:].lower())\
.replace('$HOSTADDRESS$', row["host_address"])\
+ .replace('$SERVICEOUTPUT$',
row.get("service_plugin_output", ""))\
+ .replace('$HOSTOUTPUT$', row.get("host_plugin_output",
""))\
.replace('$SERVICEDESC$', row.get("service_description",
""))
+
for f in files:
contents.append(replace_tags(unicode(file(f).read(),
"utf-8").strip()))
return "", "<hr>".join(contents)
@@ -752,7 +755,7 @@ def paint_custom_notes(row):
multisite_painters["svc_custom_notes"] = {
"title" : _("Custom services notes"),
"short" : _("Notes"),
- "columns" : [ "host_name", "host_address",
"service_description" ],
+ "columns" : [ "host_name", "host_address",
"service_description", "service_plugin_output" ],
"paint" : paint_custom_notes,
}
@@ -1152,7 +1155,7 @@ multisite_painters["host_contact_groups"] = {
multisite_painters["host_custom_notes"] = {
"title" : _("Custom host notes"),
"short" : _("Notes"),
- "columns" : [ "host_name", "host_address" ],
+ "columns" : [ "host_name", "host_address",
"host_plugin_output" ],
"paint" : paint_custom_notes,
}