Module: check_mk
Branch: master
Commit: b6dce8bd6d23e465f3d479ba1ccd4ce2720d10b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6dce8bd6d23e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 14 14:50:35 2017 +0100
4331 FIX check_sql: Is now printing FreeTDS debug messages in verbose mode (with MSSQL)
Change-Id: Ic6446edc801a2f79e19e2863f8c25523ee46278f
---
.werks/4331 | 9 +++++++++
ChangeLog | 2 ++
active_checks/check_sql | 7 ++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/4331 b/.werks/4331
new file mode 100644
index 0000000..2e3c43b
--- /dev/null
+++ b/.werks/4331
@@ -0,0 +1,9 @@
+Title: check_sql: Is now printing FreeTDS debug messages in verbose mode (with MSSQL)
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.5.0i1
+Date: 1487080179
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 8834fc5..51038e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
1.5.0i1:
+ Checks & Agents:
+ * 4331 FIX: check_sql: Is now printing FreeTDS debug messages in verbose mode (with
MSSQL)
1.4.0b1:
diff --git a/active_checks/check_sql b/active_checks/check_sql
index 65f4721..a2079bf 100755
--- a/active_checks/check_sql
+++ b/active_checks/check_sql
@@ -30,7 +30,9 @@
#
https://pypi.python.org/pypi/ibm_db
-import sys, getopt
+import sys
+import getopt
+import os
def usage():
@@ -166,6 +168,9 @@ try:
db=opt_name, user=opt_user, passwd=opt_password )
elif opt_dbms == "mssql":
+ if opt_verbose:
+ os.environ["TDSDUMP"] = "stdout"
+
import pymssql # mssql driver
db = pymssql
if opt_port == None: