Logical Disk Fragmentation Level

Microsoft.Windows.Server.6.2.LogicalDisk.DefragAnalysis (UnitMonitor)

This monitor runs on a periodic basis (Every Saturday at 3 a.m. by default) to check the fragmentation levels of all logical drives. If fragmentation levels are found to be above threshold then by default the state of the monitor will change to "Warning" and an alert will be generated. There is a recovery named "Logical Disk Defragmentation" targeted to this monitor, which is disabled by default. If the recovery is enabled then the state change will automatically kick off a task to defragment the logical drive.

Knowledge Base article:

Summary

This monitor runs on a periodic basis (Every Saturday at 3 a.m. by default) to check the fragmentation levels of all logical drives. If fragmentation levels are found to be above threshold then by default the state of the monitor will change to "Warning" and an alert will be generated. There is a recovery named "Logical Disk Defragmentation" targeted to this monitor, which is disabled by default. If the recovery is enabled then the state change will automatically kick off a task to defragment the logical drive.

Configuration

This monitor has the following overridable parameters, in addition to what is generically available for all monitors:

Causes

When new files are created or data is added to existing files, the file system attempts to allocate space as continuously as it can so that read operations can perform as fast as possible. Over time, allocating space in contiuous sections becomes less and less likely and the result is that files are fragmented across the disk(s). The more fragmented the files on a disk become, the longer it will take the file system to work with those files, which can slow the overall system.

Resolutions

NOTE: Defragmenting a drive can be a resource intensive operation and may slow down system performance while it is being performed. It may be preferrable to defragment drives during off hours.

If the fragmentation threshold for the drive is appropriate then the issue can be resolved by defragmenting the drive via one of the following means:

This monitor does not support the on-demand "recalculate health" feature of the Health Explorer window in the Operations Console. When the issue is resolved and the alert is closed either manually reset the monitor's state or wait for the next scheduled interval for the monitor to automatically reset.

Element properties:

TargetMicrosoft.Windows.Server.6.2.LogicalDisk
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.Windows.Server.6.2.LogicalDisk.DefragAnalysis.Monitortype
RemotableTrue
AccessibilityPublic
Alert Message
Logical Disk Fragmentation Level is high
The disk {0} on computer {1} has high fragmentation level. File Percent Fragmentation value is {2}\%. Defragmentation recommended: {3}.
RunAsSystem.PrivilegedMonitoringAccount

Source Code:

<UnitMonitor ID="Microsoft.Windows.Server.6.2.LogicalDisk.DefragAnalysis" RunAs="System!System.PrivilegedMonitoringAccount" Accessibility="Public" Enabled="false" Target="WindowsServer!Microsoft.Windows.Server.6.2.LogicalDisk" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.Windows.Server.6.2.LogicalDisk.DefragAnalysis.Monitortype" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.Windows.Server.6.2.LogicalDisk.DefragAnalysis.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="Windows!Microsoft.Windows.LogicalDevice"]/DeviceID$ ($Target/Property[Type="Windows!Microsoft.Windows.LogicalDevice"]/Name$)</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='FilePercentFragmentation']$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='OSRecommended']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="UnderThreshold" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="OverThreshold" MonitorTypeStateID="Success" HealthState="Success"/>
</OperationalStates>
<Configuration>
<SchedulerStart>03:00</SchedulerStart>
<SchedulerDaysOfWeekMask>64</SchedulerDaysOfWeekMask>
<FilePercentFragmentationThreshold>10</FilePercentFragmentationThreshold>
<UseOSRecommendation>true</UseOSRecommendation>
</Configuration>
</UnitMonitor>