Home > Authoring, Operations Manager 2007, Rules > Rule to Generate an Alert when X events in Y minutes

Rule to Generate an Alert when X events in Y minutes

This came up on the forums recently and it is a fairly frequent request. So here I run through how to create a composite data source that allows you to create a rule that checks for x events in y minutes with both the event count and the time interval exposed as overrides.

Create a new Empty Management Pack (e.g. called XEventsInYMinutes)

image

Assign a Display Name of Alert on X Events In Y Minutes

image

Go to Type Library and create a new composite data source

image

Give the composite data source a unique identifier e.g. XEventsInYMinutes.ConsolidatedEvents

image

Enter a Display Name e.g X Events In Y Minutes Consolidated Events

image

Go to the Configuration Schema tab and under Simple Configuration Schema, click Add

image

Add IntervalInSeconds and EventCount (note – these are case sensitive in the authoring console!) and then make sure you change the type to Integer as follows

image

Go to the Overridable Parameters tab and add in the IntervalInSeconds and EventCount parameters and make sure you set each as Integer

image

On the Member modules tab, Add a Data Source of type Microsoft.Windows.EventProvider and give it a Module ID of Event

image

Click Configure

image

Choose windows event log e.g. Application

image

Choose Expression

image

You should then see the following

image

For Computer Name – note this from the help files:

The ComputerName parameter is most commonly passed to the module by using the $Target notation, although it can be specified as any string. This module attempts to connect either to the local computer’s event log or to a remove event log, depending on the configuration passed.

For a workflow that is targeted at Windows Computer, the ComputerName element is specified as shown in the following code:

$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$

If the target is a class hosted by computer hosting, references are added as required. For example:

$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$

The ComputerName parameter is optional, but as a best practice, it should be specified.

I am going to target the rule at Microsoft.Windows.Computer so best practice means I should enter the Computer Name as

$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$

Click OK to get back to

image

The Add a new Condition Detection module of type System.ConsolidatorCondition  with a Module ID of EventConsolidation

image

Then click Configure

image

And then click Configure again and change the Consolidation Settings. Each of these settings are discussed here

image

The click on the Edit button in the bottom right of the above screen shot to set the event properties that have to identical for events to be considered identical

image

Then click OK and OK again to get the following.

image

We want to expose the IntervalInSeconds and EventCount as overridable so change the fields to match the following

$Config/IntervalInSeconds$

$Config/EventCount$

image

Then click OK to get back to the following

image

Change the Next Module setting so that the Event module goes to the Event Consolidation Module and the Event Consolidation Module is set to module output as follows

image

Check data type

image

Then click OK and go to Health Model, Rules, New Custom Rule

image

Choose unique identifier e.g. XEventsInYMinutes.Event123

image

Set the Display Name and Target

image

On the modules tab, add the XEventsInYMinutes.ConsolidatedEvents module and assign a Module ID e.g. Event123XEventsInYMinutes

image

Configure the default settings for TimeIntervalInMinutes and EventCount

image

On the actions tab we need to generate an alert so add the module System.Health.GenerateAlert and provide a module ID e.g. Event123Alert

image

Then on the Action window, click Edit and then Configure to get the following

 image

We can set an alert name, description, priority, severity, alert suppression, and any custom properties that we want to set.

image

Advertisement
  1. September 19, 2011 at 6:57 pm | #1

    It took me a second to figure out that this is not for SCOM 2007 R2. How would you accomplish this via R2? I know that you can do timed evntlog captures in R2, but not sure if this specific method you outlined here can be utilized in R2? Can it????

    Thanks for any replies!

  2. January 2, 2012 at 5:45 pm | #2

    This applies equally to SCOM 2007 R2 and SCOM 2012 – you do need to use the authoring console though. It can’t be done from the main SCOM monitoring console.

  1. No trackbacks yet.
You must be logged in to post a comment.
Follow

Get every new post delivered to your Inbox.