sqlinsight-pro/src/SQLInsight.Rules/BuiltInRules.cs
Søren Eggert Lundsteen Olsen d27323a1a4 Availability groups: cluster node or witness down (D)
The availability group collector also reads sys.dm_hadr_cluster_members
(empty or unavailable without a WSFC), and SQLI-AG-003 (High) reports a
node or witness that is not up, with how many members are still up.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 10:56:43 +02:00

106 lines
3.5 KiB
C#

using SQLInsight.Rules.Availability;
using SQLInsight.Rules.Concurrency;
using SQLInsight.Rules.Configuration;
using SQLInsight.Rules.Databases;
using SQLInsight.Rules.Engine;
using SQLInsight.Rules.Indexes;
using SQLInsight.Rules.Instance;
using SQLInsight.Rules.Lifecycle;
using SQLInsight.Rules.Performance;
using SQLInsight.Rules.Security;
namespace SQLInsight.Rules;
public static class BuiltInRules
{
/// <param name="knowledge">The rule pack behind the version rules; the embedded one if null.</param>
public static IReadOnlyList<IRule> Create(RuleKnowledge? knowledge = null)
{
knowledge ??= RuleKnowledge.Embedded();
return
[
// Version
new SupportLifecycleRule(knowledge),
new PatchLevelRule(knowledge),
// Configuration
new MaxServerMemoryDefaultRule(),
new MaxServerMemoryTooHighRule(),
new CostThresholdRule(),
new MaxDopRule(),
new OptimizeForAdHocRule(),
.. SimpleConfigurationRules.Create(),
new PendingConfigurationRule(),
new DeadlockTraceFlagRule(),
new ConfigurationChangedRule(),
new NewPrivilegeRule(),
new TooManySysadminsRule(),
// Databases
new DatabaseStateRule(),
.. SimpleDatabaseRules.Create(),
new CompatibilityLevelRule(),
new FullBackupRule(),
new LogBackupRule(),
new CheckDbRule(),
new SuspectPagesRule(),
new VirtualLogFileRule(),
new FileGrowthRule(),
new FileMaxSizeRule(),
new QueryStoreStateRule(),
new TempdbFilesRule(),
// Performance
.. WaitRules.Create(),
new DataFileReadLatencyRule(),
new LogFileWriteLatencyRule(),
new CpuRule(),
new ConstantActivityRule(),
new SlowBackupRule(),
new CorruptionErrorRule(),
new SlowIoErrorRule(),
new SevereErrorRule(),
new LoginFailureBurstRule(),
new StackDumpRule(),
new AvailabilityGroupErrorRule(),
new LongTransactionRule(),
new LargeTransactionRule(),
new LongRunningStatementRule(),
new VersionStoreRule(),
new TempdbFullRule(),
new TempdbSessionRule(),
new StoppedServiceRule(),
new ReplicationAgentFailedRule(),
new ReplicationLatencyRule(),
new ClusterMemberDownRule(),
new MemoryGrantsPendingRule(),
new AnomalyRule(),
new PlanRegressionRule(),
new FailedForcedPlanRule(),
new ParameterSensitivityRule(),
new ImplicitConversionRule(),
new NoJoinPredicateRule(),
new ScalarUdfRule(),
new SpillRule(),
new ExcessiveGrantRule(),
// Indexes and statistics
new MissingIndexRule(),
new UnusedIndexRule(),
new DuplicateIndexRule(),
new ForwardedRecordsRule(),
new StaleStatisticsRule(),
new AutoStatisticsRule(),
// Availability and jobs
new AvailabilityGroupHealthRule(),
new AvailabilityGroupLagRule(),
new FailedJobRule(),
new AgentStoppedRule(),
// Concurrency
new BlockingRule(),
new DeadlockRule(),
];
}
}