逻辑磁盘碎片等级

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

此监视器定期运行(默认为每周六凌晨 3 点),以检查所有逻辑驱动器的碎片等级。如果发现碎片等级超过阈值,则默认情况下此监视器的状态将变为“警告”,并将生成一个警报。有一项面向此监视器的恢复操作,名为“逻辑磁盘碎片整理”,它在默认情况下是被禁用的。如果启用此恢复操作,则状态发生更改后,会自动开始执行逻辑驱动器碎片整理任务。

Knowledge Base article:

摘要

此监视器定期运行(默认为每周六凌晨 3 点),以检查所有逻辑驱动器的碎片等级。如果发现碎片等级超过阈值,则默认情况下此监视器的状态将变为“警告”,并将生成一个警报。有一项面向此监视器的恢复操作,名为“逻辑磁盘碎片整理”,它在默认情况下是被禁用的。如果启用此恢复操作,则状态发生更改后,会自动开始执行逻辑驱动器碎片整理任务。

配置

此监视器具有以下可重写参数,以及通常可用于所有监视器的内容:

原因

创建新文件或者将数据添加到现有文件中时,文件系统会尝试尽可能连续地分配空间,以便可以尽快执行读取操作。随着时间的推移,在连续部分中分配空间的可能性逐渐变小,因此会在整个磁盘中将文件分段。文件在磁盘上分段越多,文件系统处理这些文件需要的时间就越长,因此可能会使整个系统变慢。

解决方法

注意:对驱动器执行碎片整理操作可能会消耗大量资源,并且在执行时可能会减慢系统性能。最好在非繁忙时间对驱动器执行碎片整理。

如果驱动器碎片阈值合适,则可以通过以下其中一种方式对驱动器进行碎片整理来解决此问题:

此监视器不支持操作控制台中“运行状况资源管理器”窗口的按需“重新计算运行状况”功能。解决问题并关闭警报后,请手动重置监视器的状态,或者等待下一个计划的间隔,以便监视器自动重置。

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
逻辑磁盘碎片等级为高
计算机 {1} 上的磁盘 {0} 具有较高的碎片等级。“文件碎片百分比”的值为 {2}\%。推荐的碎片整理:{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>