Module: check_mk
Branch: master
Commit: c21652909b47af1b3326d47ea83c9a0941d91cd9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c21652909b47af…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jun 29 11:13:03 2015 +0200
#2347 FIX Improved error message in notify.log when sendmail is missing
---
.werks/2347 | 10 ++++++++++
ChangeLog | 3 ++-
notifications/mail | 5 ++++-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/2347 b/.werks/2347
new file mode 100644
index 0000000..33a3e9b
--- /dev/null
+++ b/.werks/2347
@@ -0,0 +1,10 @@
+Title: Improved error message in notify.log when sendmail is missing
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1435569167
+
+
diff --git a/ChangeLog b/ChangeLog
index 7255bd6..61dcaae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +3,7 @@
* 2312 New checks for EMC VPLEX: emc_vplex_cpu, emc_vplex_director_stats,
emc_vplex_if, emc_vplex_volumes...
* 1260 jolokia_metrics.perm_gen: New Check to monitor used Perm Space on a JVM
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
- * 2316 FIX: windows agent: fixed formatting errors in cached agent sections
+ * 2316 FIX: windows agent: fix garbled output of cached agent plugins...
Multisite:
* 2314 FIX: Availability: fixed exception when grouping by host or service group
@@ -14,6 +14,7 @@
Notifications:
* 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
1.2.7i2:
diff --git a/notifications/mail b/notifications/mail
index 5aa984b..481058d 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -388,7 +388,10 @@ def send_mail(m, target, from_address):
if from_address:
cmd += ['-f', from_address]
cmd += [ "-i", target]
- p = subprocess.Popen(cmd, stdin = subprocess.PIPE)
+ try:
+ p = subprocess.Popen(cmd, stdin = subprocess.PIPE)
+ except OSError:
+ raise Exception("Failed to send the mail: /usr/sbin/sendmail is
missing")
p.communicate(m.as_string())
return True