System.ExpressionFilter.IntervalSuppression

Applies To: System Center 2012 - Operations Manager, System Center 2012 R2 Operations Manager, System Center 2012 SP1 - Operations Manager

The System.ExpressionFilter.IntervalSuppression condition detection module is a filtering module that takes any input data type and outputs the same data type. There are no changes to the data item flowing through a module of this type. The module either allows the data item through or stops the data item based on the expression and the suppression settings specified as configuration.

Usage

Use this module within a workflow to filter any type of data type. Use the suppression settings for monitoring probe based workflows that run on a fixed interval, where you want the workflow to proceed only if a certain number of samples match the filter.

Type Definition

<ConditionDetectionModuleType ID="System.ExpressionFilter.IntervalSuppression" Accessibility="Public" Batching="true" Stateful="false" PassThrough="true">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>System.ExpressionEvaluatorSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="Expression" type="ExpressionType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SuppressionSettings" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="MatchCount" type="xsd:unsignedByte" />
          <xsd:element name="SampleCount" type="xsd:unsignedByte" />
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </Configuration>
  <OverrideableParameters>
    <OverrideableParameter ID="MatchCount" Selector="$Config/SuppressionSettings/MatchCount$" ParameterType="int" />
    <OverrideableParameter ID="SampleCount" Selector="$Config/SuppressionSettings/SampleCount$" ParameterType="int" />
  </OverrideableParameters>
  <ModuleImplementation Isolation="Any">
    <Native>
      <ClassID>C6410789-C1BB-4AF1-B818-D01A5367781D</ClassID>
    </Native>
  </ModuleImplementation>
  <OutputType>System.BaseData</OutputType>
  <InputTypes>
    <InputType>System.BaseData</InputType>
  </InputTypes>
</ConditionDetectionModuleType>

Parameters

The System.ExpressionFilter.IntervalSuppression module supports the following configuration parameters:

Parameter Type Overrideable Description

Expression

ExpressionType

False

Required parameter. Defines an expression that evaluates to true or false.

SuppressionSettings

Complex type

False

Required parameter. Indicates how many matches are necessary in a given set of samples before the workflow continues.

If the expression defined in the Expression parameter evaluates to true, and if the suppression settings do not take effect, the workflow will continue and the data will be passed on to the subsequent module in the workflow. If false, then the data will not be passed to the next module and the workflow will end. For more information on the ExpressionType data type, see ExpressionType.

The SuppressionSettings parameter allows some expression matches to be suppressed, depending on how many times they occur in the sample. This parameter is a complex type that consists of two elements:

Element Type Overridable Description

MatchCount

Integer

True

Required element. Indicates how many positive matches the expression filter requires before outputting a data item. A value of 1 or 0 here defaults to the original behavior of the Expression Filter which is to output on all matches.

SampleCount

Integer

True

Optional element. Indicates how many total samples (both positive and negative) to store while calculating matches. This value must be greater or equal to the match count. If it is not, or if it is missing, the sample count is set equal to the match count (that is, only consecutive matching samples will trigger output).

The purpose of using System.ExpressionFilter.IntervalSuppression instead of System.ExpressionFilter is that the suppression settings parameters can be overridden in System.ExpressionFilter.IntervalSuppression. If you do not want users to override these parameters, use System.ExpressionFilter instead. If you are using a data source that does not run on a fixed interval, use System.ExpressionFilter.EventSuppression instead.

Composition

The System.ExpressionFilter.IntervalSuppression module is a native module.

Module Type Usage

System.ExpressionFilter

Filtering module with suppression settings that can be omitted, set specific to a time period, or specific to the number of matches.

System.ExpressionFilter.EventSuppression

Filtering module with suppression settings specific to a time period.

External Module References

None

Sample

The following example shows a simple rule that runs a script that returns a random integer value between 0 and 1,000. Any value over 500 is considered “above the threshold,” and could potentially trigger an alert. However, the suppression settings are configured such that an alert will only be triggered if the random number is over 500 five times out of ten samples. Therefore, this rule uses the <SampleCount> parameter to track the number of matches in a given number of samples. This number could be adjusted lower or higher depending on the sensitivity you want for the threshold.

<TypeDefinitions>
  <ModuleTypes>
    <DataSourceModuleType ID="MPAuthor.ExpressionFilter.ScheduledProbeDS" Accessibility="Public" Batching="false">
      <Configuration>
        <xsd:element minOccurs="1" name="Interval" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        <xsd:element minOccurs="0" name="SyncTime" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
      </Configuration>
      <OverrideableParameters>
        <OverrideableParameter ID="Interval" Selector="$Config/Interval$" ParameterType="int" />
        <OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string" />
      </OverrideableParameters>
      <ModuleImplementation Isolation="Any">
        <Composite>
          <MemberModules>
            <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
              <Scheduler>
                <SimpleReccuringSchedule>
                  <Interval>$Config/Interval$</Interval>
                  <SyncTime>$Config/SyncTime$</SyncTime>
                </SimpleReccuringSchedule>
                <ExcludeDates />
              </Scheduler>
            </DataSource>
            <ProbeAction ID="Script" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
              <ScriptName>NetworkSpeed.ps1</ScriptName>
              <ScriptBody>
                
$api = new-object -comObject "MOM.ScriptAPI"
$bag = $api.CreatePropertyBag()
$randomValue = Get-Random -minimum 1 -maximum 1001
$bag.AddValue("value",$randomValue)
$bag
 

              </ScriptBody>
              <TimeoutSeconds>300</TimeoutSeconds>
            </ProbeAction>
          </MemberModules>
          <Composition>
            <Node ID="Script">
              <Node ID="Scheduler" />
            </Node>
          </Composition>
        </Composite>
      </ModuleImplementation>
      <OutputType>System!System.PropertyBagData</OutputType>
    </DataSourceModuleType>
  </ModuleTypes>
</TypeDefinitions>
<Monitoring>
  <Rules>
    <Rule ID="MPAuthor.ExpressionFilter.RandomNumberAlertRule" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
      <Category>Alert</Category>
      <DataSources>
        <DataSource ID="DS" TypeID="MPAuthor.ExpressionFilter.ScheduledProbeDS">
          <Interval>300</Interval>
          <SyncTime />
        </DataSource>
      </DataSources>
      <ConditionDetection ID="CD" TypeID="System!System.ExpressionFilter.IntervalSuppression">
        <Expression>
          <SimpleExpression>
            <ValueExpression>
              <XPathQuery Type="Integer">Property[@Name='value']</XPathQuery>
            </ValueExpression>
            <Operator>Greater</Operator>
            <ValueExpression>
              <Value Type="Integer">500</Value>
            </ValueExpression>
          </SimpleExpression>
        </Expression>
        <SuppressionSettings>
          <MatchCount>5</MatchCount>
          <SampleCount>10</SampleCount>
        </SuppressionSettings>
      </ConditionDetection>
      <WriteActions>
        <WriteAction ID="Alert" TypeID="Health!System.Health.GenerateAlert">
          <Priority>1</Priority>
          <Severity>2</Severity>
          <AlertMessageId>$MPElement[Name="MPAuthor.ExpressionFilter.RandomNumberAlertRule.AlertMessage"]$</AlertMessageId>
        </WriteAction>
      </WriteActions>
  </Rules>
</Monitoring>

Information

   

Module Type

ConditionDetectionModuleType

Input Type

System.BaseData

Output Type

System.Event.Data

Implementation

Native

Library

System.Library