From 1bcfe234dc5068b15789223800130a040e8508d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A1udio=20Silva?= Date: Thu, 28 Apr 2022 17:09:02 +0100 Subject: [PATCH] add databaseMailEnabled skip config #887 --- checks/Agentv5.Tests.ps1 | 2 +- internal/configurations/configuration.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/checks/Agentv5.Tests.ps1 b/checks/Agentv5.Tests.ps1 index ea0c7872..7b7043b3 100644 --- a/checks/Agentv5.Tests.ps1 +++ b/checks/Agentv5.Tests.ps1 @@ -38,7 +38,7 @@ BeforeDiscovery { Describe "Database Mail XPs" -Tag DatabaseMailEnabled, CIS, security -ForEach $InstancesToTest { $DatabaseMailEnabled = Get-DbcConfigValue policy.security.DatabaseMailEnabled - $skip = Get-DbcConfigValue skip.instance.databasemailenabled + $skip = Get-DbcConfigValue skip.agent.databasemailenabled Context "Testing Database Mail XPs on <_.Name>" { It "Testing Database Mail XPs is set to $DatabaseMailEnabled on <_.Name>" -Skip:$skip { $PSItem.Configuration.DatabaseMailEnabled | Should -Be $PSItem.ConfigValues.DatabaseMailEnabled -Because 'The Database Mail XPs setting should be set correctly' diff --git a/internal/configurations/configuration.ps1 b/internal/configurations/configuration.ps1 index de3309dc..126f380c 100644 --- a/internal/configurations/configuration.ps1 +++ b/internal/configurations/configuration.ps1 @@ -254,6 +254,7 @@ Set-PSFConfig -Module dbachecks -Name skip.hadr.listener.tcpport -Validation boo Set-PSFConfig -Module dbachecks -Name skip.hadr.replica.tcpport -Validation bool -Value $false -Initialize -Description "Skip the HADR Replica TCP port number (If port number is not standard across the entire AG architecture)" Set-PSFConfig -Module dbachecks -Name skip.hadr.listener.pingcheck -Validation bool -Value $false -Initialize -Description "Skip the HADR listener ping test (especially useful for Azure and AWS)" Set-PSFConfig -Module dbachecks -Name skip.instance.defaulttrace -Validation bool -Value $false -Initialize -Description "Skip the default trace check" +Set-PSFConfig -Module dbachecks -Name skip.agent.databasemailenabled -Validation bool -Value $false -Initialize -Description "Skip the long Database Mail Enabled agent check" Set-PSFConfig -Module dbachecks -Name skip.agent.longrunningjobs -Validation bool -Value $false -Initialize -Description "Skip the long running agent jobs check" Set-PSFConfig -Module dbachecks -Name skip.agent.lastjobruntime -Validation bool -Value $false -Initialize -Description "Skip the last agent job time check" Set-PSFConfig -Module dbachecks -Name skip.instance.dac -Validation bool -Value $false -Initialize -Description "Skip Dedicated Administrator Connection (DAC) check"