«

»

Jun 15 2013

Print this Post

How to deal with SCOM fragmentation alerts?

Have you just installed the Windows Server Management Packs only to find that next Saturday a flood of warnings saying that your drives’ fragmentation levels are high? Well, here is how to deal with this monitor.

But first, understand that this monitors runs a check every Saturday at 3:00 AM by default, and running the recovery task (disk defragmentation) from OpsMgr console will not resolve this warning, you have to either close it manually or wait for a week for it to be closed.

Alerts

Ideally you should do 3 things:

  1. Allow SCOM to automatically defrag the HDDs if the threshold is reached in the future
  2. Disable the alert generation of this monitor since it won’t resolve itself.
  3. Run disk defragmentation on the currently affected drives and close the alerts.

1. Change the Recovery Action to automatically start once high fragmentation levels are detected

  • From Authoring>Management Pack Objects>Monitors search for “Logical Disk Fragmentation Level”

Monitor

  • Right click Logical Disk Fragmentation Level>Properties>Diagnostic and Recovery>Configure recovery tasks>Edit…
  • Overrides>Disable…>For all Objects of class: Windows Server 20XX Logical Disk
  • Check Override the Enabled Parameter and change the Override Value to True
  • Select the appropriate destination management pack the click OK

Defrag Override

  • Close all property wizard

2. Disable the alert generation of this monitor

  • Right click Logical Disk Fragmentation Level>Overrides>Override the Monitor>For all objects of class: Windows Server 20XX Logical Disk

Monitor Override

  • Change the value of the Generated Alert Parameter to False
  • Choose the appropriate management pack and click OK

Monitor Override 2

3. Run disk defragmentation on the currently affected drives and close the alerts

  • Use this PowerShell Script to start the defragmentation task for all affected disks

[powershell]
$DefragAlerts=Get-SCOMAlert -Name "Logical Disk Fragmentation Level is high"
for ($i=0; $i -lt $DefragAlerts.Count; $i++)
{
$Instance=Get-SCOMClassInstance | where {$_.FullName -eq $DefragAlerts[$i].MonitoringObjectFullName}
if ($DefragAlerts[$i].MonitoringObjectFullName -like "Microsoft.Windows.Server.6.2*")
{
$DefragTask=Get-SCOMTask | where {($_.DisplayName -like "*Defragmentation*") -and ($_.Name -like "*6.2*")}
Start-SCOMTask -Task $DefragTask -Instance $Instance
}
if ($DefragAlerts[$i].MonitoringObjectFullName -like "Microsoft.Windows.Server.2008*")
{
$DefragTask=Get-SCOMTask | where {($_.DisplayName -like "*Defragmentation*") -and ($_.Name -like "*2008*")}
Start-SCOMTask -Task $DefragTask -Instance $Instance
}
if ($DefragAlerts[$i].MonitoringObjectFullName -like "Microsoft.Windows.Server.2003*")
{
$DefragTask=Get-SCOMTask | where {($_.DisplayName -like "*Defragmentation*") -and ($_.Name -like "*2003*")}
Start-SCOMTask -Task $DefragTask -Instance $Instance
}
}
[/powershell]

  • Check the SCOM console for the status of the tasks

Tasks

  • Close all the alerts from Active Alerts view

Resources:

About the author

Walid AlMoselhy

Permanent link to this article: http://almoselhy.azurewebsites.net/2013/06/how-to-deal-with-scom-fragmentation-alerts/

3 comments

  1. Rigo

    Hi Norman,Well, a transition phase could be to let Nagios run as berfoe and implement SCOM in parallel. Then deploy SCOM and the SCOM Agent to the Servers and if the SCOM Monitoring is o.k. remove the Nagios Agent from the servers.I don’t know a nagios to scomconnector. Regards,Stefan

  2. Jakab

    Hi VishalDid you install the Operations Manager 2012 colnose on the system you are executing the script? The script needs Excel 2010 and the SCOM 2012 colnose to be installed.Regards,Stefan

  3. Wieneke

    Hi Stefen,I am getting the beollw error.:Unable to find type [parameter(mandatory=$true)]: make sure that the assembly containing this type is loaded.At C:\Documents and Settings\My_Profile\Desktop\GreyedOut.ps1:1 char:35+ Param([parameter(mandatory=$true)][ <<<< String]$scom)Can you help me out.

Leave a Reply

Your email address will not be published. Required fields are marked *