Kevin Holman's System Center Blog

Posts in this blog are provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified in the Terms of UseAre you interested in having a dedicated engineer that will be your Mic

New Base OS MP 6.0.6667.0 adds file fragmentation monitor to all Logical Disks

New Base OS MP 6.0.6667.0 adds file fragmentation monitor to all Logical Disks

  • Comments 20
  • Likes

I recently blogged about the new Base OS MP that was recently released:  HERE

 

One of the things you will notice RIGHT off the bat… is that a huge percentage of your logical disks will go into a warning state, if you don't already have some sort of scheduled defragmentation set up.  This will be true for virtual machines and physical machines…. anything over 10 percent file fragmentation (or the OS recommended setting) will get hit:

 

image

 

image

 

You will also get many warning alerts on this monitor…. the first time the condition is detected and the state changes for this monitor.  This monitor checks status every Saturday, at 3:00AM by default, for all logical disks discovered.

 

image

 

 

If you don't care about this monitoring in SCOM – disable this monitor using overrides.

If you do care about seeing the state change – but don't want the alerts – turn the “Generates Alert” property to False, using overrides.

 

You can adjust the threshold from 10% to some other number…. but make sure you take note – this monitor will ignore the “File Percent Fragmentation” property by default, and always use the OS recommended setting.  If you want to control this – you also need to set “Use OS Recommendation” to FALSE.

 

Here is an example of hard coding the frag percentage to 20% from the OS default:

image

 

“Use OS Recommendation” property description:

image

 

 

Lastly – one thing of interest….  If you want SCOM to “fix” the fragmentation issue…. it can.  There is a recovery on this very monitor that can run a VBScript that will run a defrag job against your logical disks.  It is disabled by default. 

 

image

 

Keep in mind – if you turn on this defrag…. on your physical boxes – it wont be a big deal… it will simply fix the fragmentation issue.  However – this will also run on ALL yours VM’s.  If this was triggered all at the same time – Saturday at 3:00AM by default – this can kill the disk I/O on the disk subsystem hosting your VM/VHD files.  Keep this in mind if you decide to enable this….   This recovery will only run when the state change is detected… as a recovery to the condition, so any disks that are already in a warning state will not run this recovery should you enable it.  This defrag has a timeout of 1 hour…. so it should kill the defrag if it cannot complete within an hour.

 

Another cool thing to do – is to use the recovery action as a single run-time task. You can do this right from health explorer, to fix the disks on your own schedule:

 

image

 

Just click the link, and run the task:

image

 

Minimize this…. and just let it run – you can come back in 1 hour – and see if it completed, or timed out.

 

You can also monitor for task status in the Task Status list in the console:

 

image

 

 

On the agent – you will see the following events logged in the OpsMgr event log:

 

Log Name:      Operations Manager
Source:        Health Service Script
Date:          9/28/2009 10:50:04 AM
Event ID:      4002
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      OMDW.opsmgr.net
Description:
Microsoft.Windows.Server.LogicalDisk.Defrag.vbs : Perform Defragmentation (disk: C:; computer: OMDW.opsmgr.net).

And when completed:

 

Log Name:      Operations Manager
Source:        Health Service Script
Date:          9/28/2009 11:03:44 AM
Event ID:      4002
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      OMDW.opsmgr.net
Description:
Microsoft.Windows.Server.LogicalDisk.Defrag.vbs : Defragmentation completed (disk: C:; computer: OMDW.opsmgr.net): FilePercentFragmentation = 0.

Comments
  • is there any documentation on the output? my tasks are "succeeding" but the output text for all my sql servers and a few others is

    Defrag failed (disk: D:; computer: agent.domain.com). Return code: 2..

    or sometimes the return code is 8.

    also sometimes when it does succeed fragmentation is still pretty high:

    Defragmentation completed (disk: C:; computer: otheragent.domain.com): FilePercentFragmentation = 36

  • I find it useful to change the day to the evening \ overnight of install. As a consultant it is good to this checked then rather than over a weekend when I might not be back onsite for a few weeks.

    http://technet.microsoft.com/en-us/library/dd391818.aspx

    The DaysOfWeekMask element represents one or more days of the week that the window should run. A single day or multiple days can be specified according to the following values:

    Day Value

    Sunday

    1

    Monday

    2

    Tuesday

    4

    Wednesday

    8

    Thursday

    16

    Friday

    32

    Saturday

    64

    To specify a single day, enter the enumerator value for that day into the DaysOfWeekMask configuration element.

    To specify multiple days, add the values for the days together. For example, for Monday, Wednesday and Friday you would specify 42 (2+8+32).

    Multiple windows can be specified as shown in the following example, which has two windows, one from 9:00 to 10:00, Monday to Friday and the other 17:00 to 18:00, Monday and Friday:

  • Also, note that there is no monitor for windows 2000 logical disk (either server or client) or any other client monitoring (including no monitoring of business critical desktops).

    Cheers

    Graham

  • Hello,

    Where could I find the OS Recommended value running by default?

    This article is excellent but the management wants to know the default values before approving the changes...

    As it could be different foe each OS, hardware a sample would be fine

    Thanks,

    Dom

  • How do you enable the recovery to fix the state?  I cant figure out that opiton, the run auto box is grayed out.

  • You enable recoveries via overrides.  On the monitor - go to the overrides tab - there you can enable the recovery if you so choose.

  • Hi Kevin

    further to this mgt pack and the logical disk drive fragmentation monitor - is it possible to set 2 levels for the alerts eg a warning at 60% fragmentation which clocks over to a Critical at 85%? If so how do we do it? I see the Health tab shows the two standard levels but doesn't look like you can edit to add a 3rd and associated thresholds for each?

    thanks in advance!

    Nick

  • pretty sure this is only a 2 state monitor - only one threshold.

  • Hi.

    My Exchange and SQL servers report 99% fragmentation on drive that hold the DB.

    Where can I read up on SQL / Exchange and file system fragmentation? Especially as they are iSCSI drives.

  • On Win2008 R2 CSV... it give crash on cluster.

    disble the monitor to all Logical Disks

  • Hello, is there a way I can pull the context info (eg. Time, Operational State)per state change of a monitor from Command Shell ?

    Cheers,

    Wei

  • Hi.

    I am new to SCOM and wish to enable the Auro Recovery option.

    Whne I go to the monitor I find the auto recovery is gred out how can I change this.

    Andy

  • Hi.

    I am new to SCOM and wish to enable the Auto Recovery option.

    Whne I go to the monitor I find the auto recovery is gred out how can I change this.

    Andy

  • Andy, did you ever find a solution to your problem?  I also would like to enable the auto recovery option, but its grayed out.

  • Guys - you cannot edit a recovery - you override the recovery.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
Search Blogs