Module: check_mk
Branch: master
Commit: 86573bcb163717e5befd41ad4f5bc10638169ae3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=86573bcb163717…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jun 29 11:18:29 2015 +0200
#2349 FIX HTML-Mails: Fixed state colors in Outlook
---
.werks/2349 | 10 ++++++++++
ChangeLog | 1 +
notifications/mail | 29 +++++++++++++++++++++++------
3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/.werks/2349 b/.werks/2349
new file mode 100644
index 0000000..dc6854f
--- /dev/null
+++ b/.werks/2349
@@ -0,0 +1,10 @@
+Title: HTML-Mails: Fixed state colors in Outlook
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1435569489
+
+
diff --git a/ChangeLog b/ChangeLog
index ddfc572..5552d05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
* 2313 FIX: notification bulking: fixed exception for plugins which are not
configured with checkboxes, e.g. sms
* 2347 FIX: Improved error message in notify.log when sendmail is missing
* 2348 FIX: HTML-Mails: Added missing link to service descriptions
+ * 2349 FIX: HTML-Mails: Fixed state colors in Outlook
1.2.7i2:
diff --git a/notifications/mail b/notifications/mail
index aa597f8..2e993e4 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -141,34 +141,51 @@ tr.even2 { background-color: #ffaaaa; }
tr.odd3 { background-color: #ffe0a0; }
tr.even3 { background-color: #ffefaf; }
-span.state {
+.stateOK, .stateUP {
padding-left: 3px;
padding-right: 3px;
border-radius: 2px;
font-weight: bold;
-}
-
-.stateOK, .stateUP {
background-color: #0b3; color: #ffffff;
}
.stateWARNING {
+ padding-left: 3px;
+ padding-right: 3px;
+ border-radius: 2px;
+ font-weight: bold;
background-color: #ffff00; color: #000000;
}
.stateCRITICAL, .stateDOWN {
+ padding-left: 3px;
+ padding-right: 3px;
+ border-radius: 2px;
+ font-weight: bold;
background-color: #ff0000; color: #ffffff;
}
.stateUNKNOWN, .stateUNREACHABLE {
+ padding-left: 3px;
+ padding-right: 3px;
+ border-radius: 2px;
+ font-weight: bold;
background-color: #ff8800; color: #ffffff;
}
.statePENDING {
+ padding-left: 3px;
+ padding-right: 3px;
+ border-radius: 2px;
+ font-weight: bold;
background-color: #888888; color: #ffffff;
}
.stateDOWNTIME {
+ padding-left: 3px;
+ padding-right: 3px;
+ border-radius: 2px;
+ font-weight: bold;
background-color: #00aaff; color: #ffffff;
}
@@ -498,11 +515,11 @@ def construct_content(context):
# NOTIFICATIONTYPE is "CUSTOM"
html_info = ""
- html_state = '<span class="state
state$@STATE$">$@STATE$</span>'
+ html_state = '<span
class="state$@STATE$">$@STATE$</span>'
notification_type = context["NOTIFICATIONTYPE"]
if notification_type in [ "PROBLEM", "RECOVERY" ]:
txt_info = "$PREVIOUS@HARDSHORTSTATE$ -> $@SHORTSTATE$"
- html_info = '<span class="state
state$PREVIOUS@HARDSTATE$">$PREVIOUS@HARDSTATE$</span> → ' + \
+ html_info = '<span
class="state$PREVIOUS@HARDSTATE$">$PREVIOUS@HARDSTATE$</span>
→ ' + \
html_state
elif notification_type.startswith("FLAP"):