Module: check_mk
Branch: master
Commit: d3ebdf713b333bd947439a9183ad70df6251a2c6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d3ebdf713b333b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 11 10:56:50 2016 +0200
Fixed bug in mssql instance agent plugin output of tablespaces etc.
---
agents/windows/plugins/mssql.vbs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/agents/windows/plugins/mssql.vbs b/agents/windows/plugins/mssql.vbs
index 3e0faf7..b3932ad 100644
--- a/agents/windows/plugins/mssql.vbs
+++ b/agents/windows/plugins/mssql.vbs
@@ -152,6 +152,7 @@ Set service = Nothing
Set WMI = Nothing
Set registry = Nothing
+
Dim CONN, RS, CFG, AUTH
' Initialize database connection objects
@@ -275,7 +276,7 @@ For Each instance_id In instances.Keys
Set RS = RS.NextRecordset
i = i + 1
Loop
- addOutput("MSSQL_" & instance & " " &
Replace(dbName, " ", "_") & " " & dbSize &
" " & _
+ addOutput("MSSQL_" & instance_id & " " &
Replace(dbName, " ", "_") & " " & dbSize &
" " & _
unallocated & " " & reserved & " "
& data & " " & indexSize & " " & unused)
Set RS = CreateObject("ADODB.Recordset")
Next
@@ -291,7 +292,7 @@ For Each instance_id In instances.Keys
Do While Not RS.Eof
lastBackupDate = Trim(RS("last_backup_date"))
If lastBackupDate <> "" Then
- addOutput("MSSQL_" & instance & " " &
Replace(dbName, " ", "_") & _
+ addOutput("MSSQL_" & instance_id & " " &
Replace(dbName, " ", "_") & _
" " & lastBackupDate)
End If
RS.MoveNext
@@ -311,7 +312,7 @@ For Each instance_id In instances.Keys
" case when max_size = '-1' then '1' else
'0' end as Unlimited" &_
" FROM sys.database_files WHERE type_desc = 'LOG'",
CONN
Do While Not RS.Eof
- addOutput( instId & " " & Replace(dbName, " ",
"_") & " " & Replace(RS("name"), " ",
"_") & _
+ addOutput( instance_id & " " & Replace(dbName, "
", "_") & " " & Replace(RS("name"), "
", "_") & _
" " & Replace(RS("physical_name"), "
", "_") & " " & _
RS("MaxSize") & " " &
RS("AllocatedSize") & " " & RS("UsedSize")) &
_
" " & RS("Unlimited")
@@ -332,7 +333,7 @@ For Each instance_id In instances.Keys
" case when max_size = '-1' then '1' else
'0' end as Unlimited" &_
" FROM sys.database_files WHERE type_desc = 'ROWS'",
CONN
Do While Not RS.Eof
- addOutput( instId & " " & Replace(dbName, " ",
"_") & " " & Replace(RS("name"), " ",
"_") & _
+ addOutput( instance_id & " " & Replace(dbName, "
", "_") & " " & Replace(RS("name"), "
", "_") & _
" " & Replace(RS("physical_name"), "
", "_") & " " & _
RS("MaxSize") & " " &
RS("AllocatedSize") & " " & RS("UsedSize")) &
_
" " & RS("Unlimited")