Auto Shrink Flag

Microsoft.SQLServer.2008.Database.Configuration.AutoShrink (UnitMonitor)

Monitors the auto shrink flag on the database

Knowledge Base article:

Summary

This monitor checks the Auto Shrink setting for this database. A warning or error alert will be raised if it does not match the required setting.

Out of the box, the monitor is configured to alert when this setting is True. This can be changed using overrides as required.

Causes

An unhealthy state is caused by the Auto Shrink setting for the database not matching the specified setting (False is the default)

Resolutions

This issue may be resolved by changing the Auto Shrink setting on the database.

Alternatively if the current setting is valid:

Element properties:

TargetMicrosoft.SQLServer.2008.Database
Parent MonitorSystem.Health.ConfigurationState
CategoryConfigurationHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2008.DBConfigurationStatus
RemotableTrue
AccessibilityPublic
Alert Message
Auto Shrink Flag
The auto shrink flag for database {2} in SQL instance {1} on computer {0} is not set according to best practice
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.Database.Configuration.AutoShrink" Accessibility="Public" Enabled="onStandardMonitoring" Target="SQL2008Core!Microsoft.SQLServer.2008.Database" ParentMonitorID="SystemHealth!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.DBConfigurationStatus" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.Database.Configuration.AutoShrink.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ConfigurationValueOK" MonitorTypeStateID="ConfigurationValueOK" HealthState="Success"/>
<OperationalState ID="ConfigurationValueNotOK" MonitorTypeStateID="ConfigurationValueNotOK" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
<ConfigValue>AutoShrink</ConfigValue>
<ExpectedValue>false</ExpectedValue>
<ExcludeOnExpress>false</ExcludeOnExpress>
<SQLSKU>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/Edition$</SQLSKU>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>