Skip to content

Commit 5eb6d9f

Browse files
authored
Merge pull request #20 from Icinga:fix/mssql_health_wrong_check_exit_code
MSSQL Health reports Ok while being Warning/Critical MSSQL Health returns `Ok` while the actual state is `Warning` or `Critical` because if an uncaptured invisible return value from `Start-IcingaTimer`
2 parents 92e3171 + 447be72 commit 5eb6d9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/Invoke-IcingaCheckMSSQLHealth.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function Invoke-IcingaCheckMSSQLHealth()
7878
# Create a unique name for our timer
7979
[string]$MSSQLTimer = [string]::Format('MSSQL_Timer_{0}', $Instance);
8080
# Start the timer to store our connection time
81-
Start-IcingaTimer $MSSQLTimer;
81+
Start-IcingaTimer $MSSQLTimer | Out-Null;
8282
# Connect to MSSQL
8383
$SqlConnection = Open-IcingaMSSQLConnection -Username $SqlUsername -Password $SqlPassword -Address $SqlHost -IntegratedSecurity:$IntegratedSecurity -Port $SqlPort -SqlDatabase $SqlDatabase -TestConnection;
8484
# Stop the timer
@@ -128,5 +128,5 @@ function Invoke-IcingaCheckMSSQLHealth()
128128

129129
$MSSQLCheckPackage.AddCheck($MSSQLConnCheck);
130130

131-
return (New-IcingaCheckResult -Check $MSSQLCheckPackage -Compile -NoPerfData $NoPerfData)
131+
return (New-IcingaCheckResult -Check $MSSQLCheckPackage -Compile -NoPerfData $NoPerfData);
132132
}

0 commit comments

Comments
 (0)