Icinga / icinga-powershell-mssql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: MSSQL Buffer Cache Hit Ratio returns wrong metric

LordHepipud opened this issue · comments

The Buffer Cache Hit Ratio used within Invoke-IcingaCheckMSSQLRessource is sometimes returning a value above 100%

[CRITICAL] Check package "MSSQL Performance (MSSQLSERVER)" - [CRITICAL] Buffer cache hit ratio
\_ [CRITICAL] Check package "SQLServer:Buffer Manager"
    \_ [CRITICAL] Buffer cache hit ratio: Value "138" is greater than threshold "90"

Regarding to Microsoft Docs this counter indicates a % value which should not be able to exceed 100%.

A fix could be one of these two options:

  1. Do the calculation as stated within this forum post

  2. Use the Windows Performance Counter metrics and validate if these results are valid:

icinga {
    (New-IcingaPerformanceCounterArray -CounterArray @(
        '\SQLServer:Buffer Manager\page life expectancy',
        '\SQLServer:Buffer Manager\Buffer cache hit ratio',
        '\SQLServer:Latches\Average Latch Wait Time (ms)')
    ).values;
}