Module: check_mk
Branch: master
Commit: ec1ba0e0df3b2fd9e47f3c1d7f089761c4cda21f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec1ba0e0df3b2f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Aug 10 15:31:02 2015 +0200
Updated bug entries #0850
---
.bugs/850 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/.bugs/850 b/.bugs/850
new file mode 100644
index 0000000..381d7c3
--- /dev/null
+++ b/.bugs/850
@@ -0,0 +1,8 @@
+Title: [AWato Hosts: Position of Icons for Bulk operations
+Component: wato
+State: open
+Date: 2015-08-10 15:28:19
+Targetversion: 1.2.7
+Class: nastiness
+
+Depending on the number of hosts in a folder, the buttons for Delete/ Edit/ Cleanup etc. are on the upper or the lower of the table. This is perplexing and not realy reasonable.
Module: check_mk
Branch: master
Commit: fbad9166363bde1a10dea0167f148786333e502c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fbad9166363bde…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Aug 10 14:43:48 2015 +0200
#1278 mssql_blocked_sessions: New Check to show blocked MSSQL Sessions
---
.werks/1278 | 9 +++++++
ChangeLog | 1 +
agents/windows/plugins/mssql.vbs | 16 ++++++++++++
checkman/mssql_blocked_sessions | 15 ++++++++++++
checks/mssql_blocked_sessions | 50 ++++++++++++++++++++++++++++++++++++++
5 files changed, 91 insertions(+)
diff --git a/.werks/1278 b/.werks/1278
new file mode 100644
index 0000000..b3b75f2
--- /dev/null
+++ b/.werks/1278
@@ -0,0 +1,9 @@
+Title: mssql_blocked_sessions: New Check to show blocked MSSQL Sessions
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1439210600
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 3d650d9..747bcd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@
* 2417 winperf_phydisk: can now work in a cluster environment
* 2523 ipmi: new wato rule to set ignored sensors and activate/deactivate summarizing
* 1277 check_ldap: It is now possible to specify a alternative Hostname...
+ * 1278 mssql_blocked_sessions: New Check to show blocked MSSQL Sessions
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/agents/windows/plugins/mssql.vbs b/agents/windows/plugins/mssql.vbs
index 69ff3d3..95d68bb 100644
--- a/agents/windows/plugins/mssql.vbs
+++ b/agents/windows/plugins/mssql.vbs
@@ -202,6 +202,21 @@ For Each instId In instIds.Keys
Loop
RS.Close
+ RS.Open "SELECT session_id, wait_duration_ms, wait_type, blocking_session_id " & _
+ "FROM sys.dm_os_waiting_tasks " & _
+ "WHERE blocking_session_id <> 0 ", CONN
+ addOutput( "<<<mssql_blocked_sessions>>>" )
+ Dim session_id, wait_duration_ms, wait_type, blocking_session_id
+ Do While NOT RS.Eof
+ session_id = Trim(RS("session_id"))
+ wait_duration_ms = Trim(RS("wait_duration_ms"))
+ wait_type = Trim(RS("wait_type"))
+ blocking_session_id = Trim(RS("blocking_session_id"))
+ addOutput( session_id & " " & wait_duration_ms & " " & wait_type & " " & blocking_session_id )
+ RS.MoveNext
+ Loop
+ RS.Close
+
' First only read all databases in this instance and save it to the db names dict
RS.Open "EXEC sp_databases", CONN
Dim x, dbName, dbNames
@@ -257,6 +272,7 @@ For Each instId In instIds.Keys
' which have at least one backup
Dim lastBackupDate
addOutput( "<<<mssql_backup>>>" )
+ addOutput( "Blocked _Sessions" )
For Each dbName in dbNames.Keys
RS.open "SELECT CONVERT(VARCHAR, DATEADD(s, DATEDIFF(s, '19700101', MAX(backup_finish_date)), '19700101'), 120) AS last_backup_date " & _
"FROM msdb.dbo.backupset " & _
diff --git a/checkman/mssql_blocked_sessions b/checkman/mssql_blocked_sessions
new file mode 100644
index 0000000..5617a78
--- /dev/null
+++ b/checkman/mssql_blocked_sessions
@@ -0,0 +1,15 @@
+title: MSSQL Blocked Sessions
+agents: windows
+catalog: app/mssql
+license: GPL
+distribution: check_mk
+description:
+ This Checks lists all bolcked sessions on a MSSQL Server. As long at least one session is blocked,
+ it will be {CRITICAL}.
+
+ This check needs the Check_MK mssql.vbs -plugin installed in
+ the agent. Please refer to the online documentation
+ for how to install that plugin.
+
+inventory:
+ One Check per Host will be created
diff --git a/checks/mssql_blocked_sessions b/checks/mssql_blocked_sessions
new file mode 100644
index 0000000..033e3e9
--- /dev/null
+++ b/checks/mssql_blocked_sessions
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+#
+# session_id, wait_duration_ms, wait_type, blocking_session_id
+# <<<mssql_blocked_sessions>>>
+# Blocked _Sessions
+# 119 232292187 LCK_M_U 75
+# 76 221526672 LCK_M_U 115
+
+
+def inventory_mssql_blocked_sessions(info):
+ return [(None, None)]
+
+def check_mssql_blocked_sessions(item, params, info):
+ if len(info) > 1:
+ for session_id, wait_duration_ms, wait_type, blocking_session_id in info[1:]:
+ yield 2, "Session %s blocked by %s (Wait %s ms, Type: %s)" % \
+ ( session_id, blocking_session_id, wait_duration_ms, wait_type )
+ else:
+ yield 0, "No blocked sessions"
+
+
+check_info['mssql_blocked_sessions'] = {
+ 'check_function' : check_mssql_blocked_sessions,
+ 'inventory_function' : inventory_mssql_blocked_sessions,
+ 'service_description' : "MSSQL Blocked Sessions",
+}
Module: check_mk
Branch: master
Commit: 4b0c014178ed7d249023681afe77b1b5c02bab16
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b0c014178ed7d…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Aug 10 11:55:46 2015 +0200
Minor code cleanup
---
agents/windows/plugins/windows_updates.vbs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/windows/plugins/windows_updates.vbs b/agents/windows/plugins/windows_updates.vbs
index 596fce4..61fc354 100644
--- a/agents/windows/plugins/windows_updates.vbs
+++ b/agents/windows/plugins/windows_updates.vbs
@@ -16,7 +16,7 @@
'
' Updated by Bastian Kuhn, 2014-03-03: Removed all caching functions cause the current agent
' has a native caching support. Make sure that you activate caching for this script in check_mk.ini
-'
+'
' 2014-04-17: Fix by Stefan Kick to handle errors. Payed by Adaptron.
' -----------------------------------------------------------------------------------------
Module: check_mk
Branch: master
Commit: 152bf4d0112c4f49d02cc5e4f1d193a5b5513e5b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=152bf4d0112c4f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Aug 10 10:49:47 2015 +0200
Fixed encoding of incoming SNMP data
---
checks/if_brocade | 2 +-
checks/if_lancom | 2 +-
modules/snmp.py | 11 +++++++++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/checks/if_brocade b/checks/if_brocade
index 7304160..56bb1c9 100644
--- a/checks/if_brocade
+++ b/checks/if_brocade
@@ -26,7 +26,7 @@
def fix_if_64_highspeed(info):
for line in info:
- if type(line[3]) == str: # not yet converted
+ if type(line[3]) in [ str, unicode ]: # not yet converted
line[3] = saveint(line[3]) * 1000000
def if_brocade_convert(info):
diff --git a/checks/if_lancom b/checks/if_lancom
index c3bd4c6..67bfc88 100644
--- a/checks/if_lancom
+++ b/checks/if_lancom
@@ -26,7 +26,7 @@
def fix_if_64_highspeed(info):
for line in info:
- if type(line[3]) == str: # not yet converted
+ if type(line[3]) in [ str, unicode ]: # not yet converted
line[3] = saveint(line[3]) * 1000000
def if_lancom_convert(info):
diff --git a/modules/snmp.py b/modules/snmp.py
index 185c65f..b0045cb 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -226,11 +226,22 @@ def get_snmp_table(hostname, ip, check_type, oid_info):
# the OIDs and watch out for gaps we need to fill with dummy values.
new_columns = sanitize_snmp_table_columns(columns)
+ # From all SNMP data sources (stored walk, classic SNMP, inline SNMP) we
+ # get normal python strings. But for Check_MK we need unicode strings now.
+ # Convert them by using the standard Check_MK approach for incoming data
+ new_columns = sanitize_snmp_encoding(new_columns)
+
info += construct_snmp_table_of_rows(new_columns)
return info
+def sanitize_snmp_encoding(columns):
+ for index, column in enumerate(columns):
+ columns[index] = map(decode_incoming_string, column)
+ return columns
+
+
def sanitize_snmp_table_columns(columns):
# First compute the complete list of end-oids appearing in the output
# by looping all results and putting the endoids to a flat list