Module: check_mk
Branch: master
Commit: 03f5560f2006443edb59e975144efbd0e45073ce
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=03f5560f200644…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 31 14:48:51 2014 +0100
#1168 FIX HTML mails can now be configured to display graphs among each other
By default all graphs are displayed besides eachother, trying to fill
horizontally as much space as possible. Now you can configure the mail
notifications to display the graphs among each other by setting the
notification parmeter.
---
.werks/1168 | 12 ++++++++++++
ChangeLog | 3 +++
notifications/mail | 10 +++++++++-
web/plugins/wato/notifications.py | 16 ++++++++++++----
4 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/.werks/1168 b/.werks/1168
new file mode 100644
index 0000000..94d65a9
--- /dev/null
+++ b/.werks/1168
@@ -0,0 +1,12 @@
+Title: HTML mails can now be configured to display graphs among each other
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.5i7
+Date: 1414763224
+Class: fix
+
+By default all graphs are displayed besides eachother, trying to fill
+horizontally as much space as possible. Now you can configure the mail
+notifications to display the graphs among each other by setting the
+notification parmeter.
diff --git a/ChangeLog b/ChangeLog
index fcbfb17..c7f7171 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
WATO:
* 1165 FIX: Fixed exception in service discovery of logwatch event console forwarding
checks...
+ Notifications:
+ * 1168 FIX: HTML mails can now be configured to display graphs among each other...
+
1.2.5i6:
Core & Setup:
diff --git a/notifications/mail b/notifications/mail
index 57f4b28..e77c21b 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -171,6 +171,11 @@ img {
margin-right: 10px;
}
+img.nofloat {
+ display: block;
+ margin-bottom: 10px;
+}
+
table.context {
border-collapse: collapse;
}
@@ -555,7 +560,10 @@ def construct_content(context):
name = '%s-%s-%d.png' % (context['HOSTNAME'], svc_desc,
source)
attachments.append(('img', name, content, 'inline'))
- graph_code += '<img src="cid:%s" />' % name
+ cls = ''
+ if context.get('PARAMETER_NO_FLOATING_GRAPHS'):
+ cls = ' class="nofloat"'
+ graph_code += '<img src="cid:%s"%s />' % (name, cls)
if graph_code:
content_html += (
diff --git a/web/plugins/wato/notifications.py b/web/plugins/wato/notifications.py
index 12d4733..0814e4b 100644
--- a/web/plugins/wato/notifications.py
+++ b/web/plugins/wato/notifications.py
@@ -78,11 +78,11 @@ register_notification_parameters("mail",
),
( "url_prefix",
TextAscii(
- title = _("URL prefix for links to Multisite"),
+ title = _("URL prefix for links to Check_MK"),
help = _("If you specify an URL prefix here, then several parts of
the "
- "email body are armed with hyperlinks to your Multisite
GUI, so "
+ "email body are armed with hyperlinks to your Check_MK
GUI, so "
"that the recipient of the email can directly visit the
host or "
- "service in question in Multisite. Specify an absolute
URL including "
+ "service in question in Check_MK. Specify an absolute URL
including "
"the <tt>.../check_mk/</tt>"),
regex = "^(http|https)://.*/check_mk/$",
regex_error = _("The URL must begin with <tt>http</tt>
or "
@@ -91,7 +91,15 @@ register_notification_parameters("mail",
default_value = "http://" + socket.gethostname() +
"/" + (
defaults.omd_site and defaults.omd_site + "/" or
"") + "check_mk/",
)
- )
+ ),
+ ( "no_floating_graphs", FixedValue(
+ True,
+ title = _("Display graphs among each other"),
+ totext = _("Graphs are shown among each other"),
+ help = _("By default all multiple graphs in emails are displayed
floating "
+ "nearby. You can enable this option to show the graphs
among each "
+ "other."),
+ )),
]
)
)