Module: check_mk
Branch: master
Commit: 1769ab6543a38c9a92ce6c38c66abcfedbf7b117
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1769ab6543a38c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Feb 5 14:10:39 2013 +0100
mail notification plugin: fixed bug in non OMD environment
---
notifications/mail | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/notifications/mail b/notifications/mail
index ec6c753..501d490 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -314,8 +314,12 @@ def send_mail(m, target):
return True
def fetch_pnp_data(context, params):
- return os.popen('REMOTE_USER="%s" php
%s/share/pnp4nagios/htdocs/index.php "%s"' %
- (context['CONTACTNAME'], context['OMD_ROOT'],
params)).read()
+ try:
+ prefix_url = "%s/share" % context['OMD_ROOT']
+ except:
+ # Non-omd environment
+ prefix_url = ""
+ return os.popen('REMOTE_USER="%s" php %s/pnp4nagios/htdocs/index.php
"%s"' % (context['CONTACTNAME'], prefix_url, params)).read()
def fetch_num_sources(context):
svc_desc = context['WHAT'] == 'HOST' and '_HOST_' or
context['SERVICEDESC']