Module: check_mk
Branch: master
Commit: 0ff41ff0e75fe66ee328065ecbd223006dd79013
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0ff41ff0e75fe6…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Dec 16 11:42:43 2015 +0100
#2815 FIX Notification scripts: Fixed missing environment variables
The notification scripts did not get any non-notification related environment variables.
For example everything specified in ~/.profile was missing.
---
.werks/2815 | 10 ++++++++++
ChangeLog | 1 +
modules/notify.py | 3 +--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/2815 b/.werks/2815
new file mode 100644
index 0000000..5ecc69c
--- /dev/null
+++ b/.werks/2815
@@ -0,0 +1,10 @@
+Title: Notification scripts: Fixed missing environment variables
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.7i4
+Date: 1450262382
+Class: fix
+
+The notification scripts did not get any non-notification related environment variables.
+For example everything specified in ~/.profile was missing.
diff --git a/ChangeLog b/ChangeLog
index 8f208e5..9cda092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -213,6 +213,7 @@
* 2811 Mail notifications: Now able to add Host/Service Notes Url...
* 2728 FIX: Removed debug notification script (was not executable)...
* 2843 FIX: Hanging notification scripts could prevent all other notifications...
+ * 2815 FIX: Notification scripts: Fixed missing environment variables...
Event Console:
* 2733 Visibility of Event Console events more flexible now...
diff --git a/modules/notify.py b/modules/notify.py
index 1acb97c..55246f5 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -1156,8 +1156,7 @@ def call_notification_script(plugin, plugin_context):
# Construct the environment for the notification script
def notification_script_env(plugin_context):
- return dict([ ("NOTIFY_" + k, v.encode("utf-8"))
- for k, v in plugin_context.items() ])
+ return dict(os.environ.items() + [("NOTIFY_" + k,
v.encode("utf-8")) for k, v in plugin_context.items()])
class NotificationTimeout(Exception):