Module: check_mk
Branch: master
Commit: d60b50e753673d0f9943abf3b7ec1e31796f40f5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d60b50e753673d…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Nov 14 16:26:32 2013 +0100
Fixes for mssql check
---
doc/treasures/active_checks/check_sql | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/treasures/active_checks/check_sql
b/doc/treasures/active_checks/check_sql
index 95a5464..761f1e1 100755
--- a/doc/treasures/active_checks/check_sql
+++ b/doc/treasures/active_checks/check_sql
@@ -167,8 +167,8 @@ try:
db = pymssql
if opt_port == None:
opt_port=1433
- db_connection = db.connect(host=opt_hostname+":"+opt_port, \
- database=opt_name, user=opt_user, passwd=opt_password )
+ db_connection = db.connect(host=opt_hostname+":"+str(opt_port), \
+ database=opt_name, user=opt_user, password=opt_password )
elif opt_dbms == "oracle":
sys.path.append('/usr/lib/python2.7/site-packages')
@@ -232,7 +232,7 @@ try:
#if len(result) > 1:
# print "UNKNOWN - SQL statement/procedure returned more than one line"
# sys.exit(3)
- if len(result) == 0:
+ if result == None or len(result) == 0:
print "UNKNOWN - SQL statement/procedure returned no data"
sys.exit(3)