Tuesday, April 24, 2012

Create SCOM 2007 R2 monitor to alert on DFS-R backlog monitoring

By default, SCOM2007 R2, DFS-R backlog monitoring count of Windows File Service Management Pack does not notify or raise any alert in case of backlog more than a defined threshold. However, it has state view dashboard where anyone can find the current number of backlog files (provided that the data is current, default configuration is to gather data in every 4 hours). Anyone can create a Timed Script Three/Two State Monitor to get alert if there are more than specific numbers of backlog.
I am going to demonstrate a Timed Script Three State Monitor to configure alert notification of DFS-R backlog.
1.       Go to the Authoring tab on the OpsMgr console
2.       Right click Monitors under Management pack Objects and Select Create a Monitor > Unit Monitor
3.       Expend Scripting > Generic > Select either Timed Script Three State Monitor or Timed Script Two State Monitor. For the purpose of this blog, I am selecting Timed Script Three State Monitor
4.       Select the Management Pack to store this monitor. I will recommend not to using the default Management Pack. The best choice is to select the File Server Customized Management Pack. Select Next
5.       Enter a Name and description to uniquely identify the Monitor. As an example I enter: Name: DFS-R Backlog Count Monitor, description: This will monitor and raise notification in the event of the DFS-R backlog count above the threshold.
6.       Select Replication Connection  as Monitor Target
7.       Leave the default Availability as Parents Monitor
8.       Leave the Monitor is enabled as selected. Click Next
9.       Select 60 Minutes for the Monitor to run the script. Click Next
10.   Enter a name for the Script, (e.g. DFS-RBacklogMonitor.vbs)
11.   Copy and paste the following line in the Script section:

Set oArgs = WScript.Arguments
numbers=oArgs(0)
Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = OAPI.CreatePropertyBag()
Call oBag.AddValue("BackLogCountFile",numbers)
Call oAPI.Return(oBag)

12.   Click Parameters….., click Target, select Backlog Count. Click OK
13.   Click OK
14.   Click Next
15.   On the Unhealthy Event Expression page: Enter, Property[@Name='BackLogCountFile'] in the Parameter Name Box, Select Greater than from the Operator option and then enter any number you want to specify the for the unhealthy state, I select 500 as an example. Click Next
16.   On the Degraded Event Expression: Enter, Property[@Name='BackLogCountFile'] in the Parameter Name Box, Select Greater than or equal to from the Operator option and then enter 100. Then click Insert and select AND Group. Then Enter, Property[@Name='BackLogCountFile'] in the Parameter Name Box again, Select Less than or equal to from the Operator option and then enter 500. Click Next
17.   On the Healthy Event Expression: Enter, Property[@Name='BackLogCountFile'] in the Parameter Name Box, Select Greater than or equal to from the Operator option and then enter 0. Then click Insert and select AND Group. Then Enter, Property[@Name='BackLogCountFile'] in the Parameter Name Box again, Select Less than or equal to rom the Operator option and then enter 100. Click Next. Click Next.
18.   Select Generate alerts for this monitor, select Automatically resolve the alert when the monitor returns to a healthy state. Enter a Name for the alert and click on … button and select the required fields you want to be on the alert body. Here is what I selected:

Replication Group: $Target/Property[Type="Windows1!Microsoft.Windows.FileServer.DFSR.ReplicationConnection"]/ReplicationGroupName$
Replicated Folder: $Target/Property[Type="Windows1!Microsoft.Windows.FileServer.DFSR.ReplicationConnection"]/ReplicatedFolderName$
Sending Member: $Target/Property[Type="Windows1!Microsoft.Windows.FileServer.DFSR.ReplicationConnection"]/SendingMemberName$
Receiving Member: $Target/Property[Type="Windows1!Microsoft.Windows.FileServer.DFSR.ReplicationConnection"]/ReceivingMemberName$
Backlog Count: $Target/Property[Type="Windows1!Microsoft.Windows.FileServer.DFSR.ReplicationConnection"]/BacklogCount$
Display Name: $Target/Property[Type="System!System.Entity"]/DisplayName$
            Select appropriate Priority and Severity.
       19. Click Create
The number used above are for indication only, you can use any number as threshold based your situation and DFS setup.

6 comments:

Darryl Voss said...

OK, I'm going this, and it's working very well. Too well in fact. The monitor seems to be going into a critical state whenever the backlog is greater than 0. Any thoughts?

Powdered Toast Man said...

I too have the same issue of any backlog triggers an alert. Has anyone else figured this out?

Paul said...

It appears there may be a logic flaw in the relational operators.

Try this:

Healthy < 500
Degraded >= 500 AND < 1000
Unhealthy >= 1000

The threshold values should be whatever works for the respective environment.

Joshua's Systems said...

I am having a problem even changing the logic. It's generating a critical alert even when I have 1 backlogged file

Anonymous said...

I believe the issues with the alert threshold are connected with the value being treated as a string rather than as a numeric value - but I'm not sure how to change that.

Anonymous said...

I was able to resolve this by exporting the management pack containing this custom monitor and manually editing the xml, changing the data type from 'String' to 'Integer'. For example:

numbers=oArgs(0)
Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = OAPI.CreatePropertyBag()
Call oBag.AddValue("BackLogCountFile",numbers)
Call oAPI.Return(oBag)
60



Property[@Name='BackLogCountFile']

GreaterEqual

50






Property[@Name='BackLogCountFile']

Less

50