[checkmk-commits] Check_MK Git: check_mk: mk_sap: try to fix exception if first connection fails

Mathias Kettner mk at mathias-kettner.de
Thu Aug 21 17:35:03 CEST 2014

Module: check_mk
Branch: master
Commit: 55c916526323c9a5adce2f4a908b03349feae2c0
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=55c916526323c9a5adce2f4a908b03349feae2c0

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Thu Aug 21 17:34:56 2014 +0200

mk_sap: try to fix exception if first connection fails


 agents/plugins/mk_sap |    1 +
 1 file changed, 1 insertion(+)

diff --git a/agents/plugins/mk_sap b/agents/plugins/mk_sap
index b0d9280..f2f32d6 100755
--- a/agents/plugins/mk_sap
+++ b/agents/plugins/mk_sap
@@ -355,6 +355,7 @@ def process_alerts(cfg, logs, ms_name, mon_name, node, alerts):
 def connect(cfg):
     global conn
+        conn = None # make sure that conn is defined, even on an exception
         conn = sapnwrfc.base.rfc_connect(cfg)
     except sapnwrfc.RFCCommunicationError, e:
         sys.stderr.write('ERROR: Unable to connect (%s)\n' % e)

More information about the checkmk-commits mailing list