[checkmk-commits] mssql_blocked_sessions: Reporting no blocked sessions in case of empty section

Lars Michelsen lm at mathias-kettner.de
Thu Sep 15 10:04:41 CEST 2016


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

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Thu Sep 15 10:04:35 2016 +0200

mssql_blocked_sessions: Reporting no blocked sessions in case of empty section

---

 checks/mssql_blocked_sessions | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/checks/mssql_blocked_sessions b/checks/mssql_blocked_sessions
index 224bfdc..e874081 100644
--- a/checks/mssql_blocked_sessions
+++ b/checks/mssql_blocked_sessions
@@ -30,15 +30,17 @@
 # 119 232292187 LCK_M_U 75
 # 76 221526672 LCK_M_U 115
 
+# TODO: Make this check aware of multiple instances! Don't handle the blocked
+# sessions independent of instances anymore. Use same service description
+# schema as "mssql_instance".
 
 def inventory_mssql_blocked_sessions(info):
     return [(None, None)]
 
 def check_mssql_blocked_sessions(_no_item, params, info):
     if not info:
-        # Assume general connection problem to the database, which is reported
-        # by the "X Instance" service and skip this check.
-        raise MKCounterWrapped("Failed to connect to database")
+	yield 0, "No blocked sessions"
+        return
 
     state = 2
     if params:



More information about the checkmk-commits mailing list