Skip to content

Commit 2913c6a

Browse files
NathanLifshesclaude
andcommitted
Add CheckID 276: AG Not Fully Configured (issue #3830)
Adds a new sp_Blitz check (priority 250, Informational) that fires when SERVERPROPERTY('IsHadrEnabled') = 1 but no databases have a replica_id, meaning AG is turned on at the server level but unused. Only runs when @CheckServerInfo = 1. Documents the check in sp_Blitz_Checks_by_Priority.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b8f084e commit 2913c6a

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

Documentation/sp_Blitz_Checks_by_Priority.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav
66

77
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.
88

9-
CURRENT HIGH CHECKID: 275.
10-
If you want to add a new one, start at 276.
9+
CURRENT HIGH CHECKID: 276.
10+
If you want to add a new one, start at 277.
1111

1212
| Priority | FindingsGroup | Finding | URL | CheckID |
1313
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
@@ -300,6 +300,7 @@ If you want to add a new one, start at 276.
300300
| 240 | Wait Stats | No Significant Waits Detected | https://www.BrentOzar.com/go/waits | 153 |
301301
| 240 | Wait Stats | Top Wait Stats | https://www.BrentOzar.com/go/waits | 152 |
302302
| 240 | Wait Stats | Wait Stats Have Been Cleared | https://www.BrentOzar.com/go/waits | 185 |
303+
| 250 | Informational | AG Not Fully Configured | https://www.BrentOzar.com/go/ag | 276 |
303304
| 250 | Informational | SQL Server Agent is running under an NT Service account | https://www.BrentOzar.com/go/setup | 170 |
304305
| 250 | Informational | SQL Server is running under an NT Service account | https://www.BrentOzar.com/go/setup | 169 |
305306
| 250 | Server Info | Agent is Currently Offline | | 167 |

sp_Blitz.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10036,6 +10036,34 @@ IF NOT EXISTS ( SELECT 1
1003610036

1003710037

1003810038

10039+
/* Check if AG is enabled at server level but no databases are in an AG */
10040+
IF NOT EXISTS ( SELECT 1
10041+
FROM #SkipChecks
10042+
WHERE DatabaseName IS NULL AND CheckID = 276 )
10043+
BEGIN
10044+
IF SERVERPROPERTY('IsHadrEnabled') = 1
10045+
AND NOT EXISTS ( SELECT 1 FROM sys.databases WHERE replica_id IS NOT NULL )
10046+
BEGIN
10047+
10048+
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 276) WITH NOWAIT;
10049+
10050+
INSERT INTO #BlitzResults
10051+
( CheckID ,
10052+
Priority ,
10053+
FindingsGroup ,
10054+
Finding ,
10055+
URL ,
10056+
Details
10057+
)
10058+
SELECT 276 AS CheckID ,
10059+
250 AS Priority ,
10060+
'Informational' AS FindingsGroup ,
10061+
'AG Not Fully Configured' AS Finding ,
10062+
'https://www.BrentOzar.com/go/ag' AS URL ,
10063+
'Availability Groups is turned on at the server level, but no databases are in an Availability Group.' AS Details;
10064+
END;
10065+
END;
10066+
1003910067
END; /* IF @CheckServerInfo = 1 */
1004010068
END; /* IF ( ( SERVERPROPERTY('ServerName') NOT IN ( SELECT ServerName */
1004110069

0 commit comments

Comments
 (0)