DB Space Free (MB)

Microsoft.SQLServer.2008.Database.DBSizeMegabytesMonitor (UnitMonitor)

Monitors for the free space left in the database in terms of megabytes.

Knowledge Base article:

Summary

This monitor checks the database absolute free space in Megabytes to ensure it is above the defined thresholds. A warning or error alert will be raised if it is below one of the defined thresholds.

Databases that have autogrow set will never generate an alert regardless of the reported free space.

Out of the box, this monitor will never cross a threshold as both thresholds are set to -1. Monitoring using percentage free space is the default behavior. If it is required to monitor using absolute free space, the threshold values for this monitor should be overridden

Causes

An unhealthy state is caused by the database running low on free space. This could be due to rapid growth or may have been developing slowly over time. Use the following link to view the historic data for this database:

Database Performance Data

Resolutions

This issue may be resolved by either:

Alternatively if database size is not a concern for the database:

Element properties:

TargetMicrosoft.SQLServer.2008.Database
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2008.DBAndLogSizeMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
DB Space Free (MB)
Database {2} in SQL Server instance {1} on computer {0} is running low on database free space
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.Database.DBSizeMegabytesMonitor" Accessibility="Public" Enabled="false" Target="SQL2008Core!Microsoft.SQLServer.2008.Database" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.DBAndLogSizeMonitorType" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.Database.DBSizeMegabytesMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</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="UnderThreshold1" MonitorTypeStateID="UnderThreshold1" HealthState="Error"/>
<OperationalState ID="OverThreshold1UnderThreshold2" MonitorTypeStateID="OverThreshold1UnderThreshold2" HealthState="Warning"/>
<OperationalState ID="OverThreshold2" MonitorTypeStateID="OverThreshold2" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<ObjectName>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/PerformanceCounterObject$:Database</ObjectName>
<CounterName>DB Free Space (MB)</CounterName>
<InstanceName>$Data/Property[@Name='Database']$</InstanceName>
<DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<Value>$Data/Property[@Name='DBFree']$</Value>
<Threshold1>-1</Threshold1>
<Threshold2>-1</Threshold2>
<AutoGrowSet>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseAutogrow$</AutoGrowSet>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>