Module: check_mk
Branch: master
Commit: 2c8408298cd9f8e2eee8d0a6ba49d82e65f98ae1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2c8408298cd9f8…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Oct 22 11:57:12 2013 +0200
FIX: mail with graph plugin: set explicit session.save_path for php
---
ChangeLog | 2 ++
notifications/mail | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 67ab390..a5c9951 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,8 @@
Notifications:
* Blacklisting for services in the felixble notification system
+ * FIX: mail with graph plugin: set explicit session.save_path for php
+ Fixes instances where the php command couldn't fetch any graphs
Checks & Agents:
* diskstat: removed (ever incorrect) latency computation for Linux
diff --git a/notifications/mail b/notifications/mail
index 6127843..7303115 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -329,14 +329,16 @@ def fetch_pnp_data(context, params):
try:
# Autodetect the path in OMD environments
path = "%s/share/pnp4nagios/htdocs/index.php" %
context['OMD_ROOT']
+ php_save_path = "-d session.save_path=%s/tmp/php/session" %
context['OMD_ROOT']
except:
# Non-omd environment - use plugin argument 1
path = context.get('PARAMETER_1', '')
+ php_save_path = "" # Using default path
if not os.path.exists(path):
raise GraphException('Unable to locate pnp4nagios index.php (%s)' %
path)
- return os.popen('REMOTE_USER="%s" php %s "%s"' %
(context['CONTACTNAME'], path, params)).read()
+ return os.popen('REMOTE_USER="%s" php %s %s "%s"' %
(context['CONTACTNAME'], php_save_path, path, params)).read()
def fetch_num_sources(context):
svc_desc = context['WHAT'] == 'HOST' and '_HOST_' or
context['SERVICEDESC']