SQL Server performance counters


Job details

Name: SQL Server performance counters
Platform: Sqlserver
Category: Maintenance
Premium package: Maintenance package
Description: Checks if SQL Server performance counters are missing.
Long description:
Version: 2
Default schedule: 0 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘1999′ & hasengine=‘YES’ & engine_edition = ‘Microsoft SQL Server’ & eng_inst_priv = 0]

Parameters

Name Default value Description
return status when missing counters values 2 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when missing counter values.

Job Summary

declare @counter_check  int
select @counter_check = count(*) from master..sysperfinfo where  counter_name in ( 'Page lookups/sec', 'Checkpoint pages/sec', 'Lazy writes/sec')   
if @counter_check != 3 
begin 
select @counter_check = count(*) from master..sysperfinfo 
select 'Missing SQL Server performance counters (number of counters: ' + cast(@counter_check as varchar(4))+').' 
end 
else 
begin 
select @counter_check = count(*) from master..sysperfinfo 
select cast(@counter_check as varchar(10))+' SQL Server performance counters checked. ' "Info" 
end

Dependencies

This monitoring job depends on the following objects:

Job Configuration and Reporting

Presentation of Job Results

The results of the monitoring are structured to provide information on:

Alarm Handling Configuration

Upon detecting discrepancies, the status value defined in the parameters (OK – 0, WARNING – 1, ALARM – 2) is applied based on the current state of the performance counters. This ensures timely notification and resolution strategies are actionable depending on the severity of the issue detected.

Procedural Implementation

The procedure involved in this monitoring job does the following:

Upgrade Path

The procedure `dbw_performance_counters_proc` has undergone updates in versions from 1.2 and 1.3 to an enhanced version provided in the detailed implementation code, reinforcing the reliability and details captured during each monitoring session.

Overall, this SQL Server performance counters monitoring job plays a crucial role in maintaining the health and performance observability of the SQL Server instances aligned with the best practices and operational requirements.