MSSQL 2008: Collect DB File Allocated Space Left (\%)

Microsoft.SQLServer.2008.DBFile.FileAllocatedSpaceLeftPercent.Collection (Rule)

The amount of space left in a file in percentage terms. Does not include space left on media hosting a file with auto grow enabled

Knowledge Base article:

Summary

The amount of space left in a file in percentage terms. Does not include space left on media hosting a file with auto grow enabled.

Element properties:

TargetMicrosoft.SQLServer.2008.DBFile
CategoryPerformanceCollection
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.2008.DBFileSizeRawPerfProvider Default
WriteToDB WriteAction Microsoft.SystemCenter.CollectPerformanceData Default
WriteToDW WriteAction Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData Default

Source Code:

<Rule ID="Microsoft.SQLServer.2008.DBFile.FileAllocatedSpaceLeftPercent.Collection" Target="SQL2008Core!Microsoft.SQLServer.2008.DBFile" Enabled="true">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.2008.DBFileSizeRawPerfProvider">
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<ConnectionString>$Target/Host/Host/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<ServerName>$Target/Host/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ServerName>
<SqlInstanceName>$Target/Host/Host/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</SqlInstanceName>
<ObjectName>SQL DB File</ObjectName>
<CounterName>DB File Allocated Space Left (%)</CounterName>
<InstanceName/>
<DatabaseName>$Target/Host/Host/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<DBFileId>$Target/Property[Type="SQL!Microsoft.SQLServer.DBFile"]/FileID$</DBFileId>
<Value>$Data/Property[@Name='FreeSpaceAutoGrowPercent']$</Value>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>