Module: check_mk
Branch: master
Commit: 0bc03e701a50f1267a571d4a4a04a0db91261a97
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0bc03e701a50f1…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Thu Apr 19 14:11:33 2018 +0200
5841 FIX MSSQL plugin: fixed instance connection setup if at least one, but not all
instances, use TCP ports
Change-Id: I75b1f86b00ca8c1c6e383978378cfd9a04b31bab
---
.werks/5841 | 11 +++++++++++
agents/windows/plugins/mssql.vbs | 6 +++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/.werks/5841 b/.werks/5841
new file mode 100644
index 0000000..0f876c2
--- /dev/null
+++ b/.werks/5841
@@ -0,0 +1,11 @@
+Title: MSSQL plugin: fixed instance connection setup if at least one, but not all
instances, use TCP ports
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1524139736
+
+
diff --git a/agents/windows/plugins/mssql.vbs b/agents/windows/plugins/mssql.vbs
index e5a8d7d..69b0bdf 100644
--- a/agents/windows/plugins/mssql.vbs
+++ b/agents/windows/plugins/mssql.vbs
@@ -152,14 +152,14 @@ For Each rk In regkeys
instance_name &
"\MSSQLServer\SuperSocketNetLib\TCP\IPAll", _
"tcpPort", tcpport
- If IsNull(cluster_name) Then
+ If IsNull(cluster_name) Or cluster_name = "" Then
cluster_name = ""
' In case of instance name "MSSQLSERVER" always use (local)
as connect string
If instance_id = "MSSQLSERVER" Then
sources.add instance_id, "(local)"
Else
- If isNull(tcpport) Then
+ If isNull(tcpport) Or tcpport = "" Then
sources.add instance_id, hostname & "\" &
instance_id
Else
sources.add instance_id, hostname & "," &
tcpport
@@ -170,7 +170,7 @@ For Each rk In regkeys
If instance_id = "MSSQLSERVER" Then
sources.add instance_id, cluster_name
Else
- If isNull(tcpport) Then
+ If isNull(tcpport) Or tcpport = "" Then
sources.add instance_id, cluster_name & "\" &
instance_id
Else
sources.add instance_id, cluster_name & "," &
tcpport