Skip to content

Commit

Permalink
#3586 - adding target & total memory counters to server info section. C…
Browse files Browse the repository at this point in the history
…loses #3586.
  • Loading branch information
BrentOzar committed Dec 9, 2024
1 parent 91db9a5 commit 57f34db
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Documentation/sp_Blitz_Checks_by_Priority.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav

If you want to change anything about a check - the priority, finding, URL, or ID - open a Github issue first. The relevant scripts have to be updated too.

CURRENT HIGH CHECKID: 265.
If you want to add a new one, start at 266.
CURRENT HIGH CHECKID: 266.
If you want to add a new one, start at 267.

| Priority | FindingsGroup | Finding | URL | CheckID |
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
Expand Down Expand Up @@ -301,6 +301,7 @@ If you want to add a new one, start at 266.
| 250 | Server Info | Drive Space | | 92 |
| 250 | Server Info | Full-text Filter Daemon is Currently Offline | | 168 |
| 250 | Server Info | Hardware | | 84 |
| 250 | Server Info | Hardware - Memory Counters | https://www.BrentOzar.com/go/target | 266 |
| 250 | Server Info | Hardware - NUMA Config | | 114 |
| 250 | Server Info | Instant File Initialization Enabled | https://www.BrentOzar.com/go/instant | 193 |
| 250 | Server Info | Locked Pages in Memory Enabled | https://www.BrentOzar.com/go/lpim | 166 |
Expand Down
30 changes: 30 additions & 0 deletions sp_Blitz.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9970,6 +9970,36 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
END;
END; /* CheckID 261 */


IF NOT EXISTS ( SELECT 1
FROM #SkipChecks
WHERE DatabaseName IS NULL AND CheckID = 266 )
BEGIN
INSERT INTO #BlitzResults
( CheckID ,
Priority ,
FindingsGroup ,
Finding ,
URL ,
Details
)
SELECT 266 AS CheckID ,
250 AS Priority ,
'Server Info' AS FindingsGroup ,
'Hardware - Memory Counters' AS Finding ,
'https://www.brentozar.com/go/target' AS URL ,
N'Target Server Memory (GB): ' + CAST((CAST((pTarget.cntr_value / 1024.0 / 1024.0) AS DECIMAL(10,1))) AS NVARCHAR(100))
+ N' Total Server Memory (GB): ' + CAST((CAST((pTotal.cntr_value / 1024.0 / 1024.0) AS DECIMAL(10,1))) AS NVARCHAR(100))
FROM sys.dm_os_performance_counters pTarget
INNER JOIN sys.dm_os_performance_counters pTotal
ON pTotal.object_name LIKE 'SQLServer:Memory Manager%'
AND pTotal.counter_name LIKE 'Total Server Memory (KB)%'
WHERE pTarget.object_name LIKE 'SQLServer:Memory Manager%'
AND pTarget.counter_name LIKE 'Target Server Memory (KB)%'
END



END; /* IF @CheckServerInfo = 1 */
END; /* IF ( ( SERVERPROPERTY('ServerName') NOT IN ( SELECT ServerName */

Expand Down

0 comments on commit 57f34db

Please sign in to comment.