Share via


System.SchedulerFilter

Applies To: Operations Manager 2007 R2

The System.SchedulerFilter module is a condition detection module type that allows for the scheduling of rules and monitors. The module takes any type of data as input and outputs System.BaseData.

Usage

Use this module to create rules and monitors that output data only within the specified scheduled interval.

Type Definition

<ConditionDetectionModuleType ID="System.SchedulerFilter" Stateful="false" Accessibility="Public" PassThrough="true" Batching="false">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>System.ExpressionEvaluatorSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="SchedulerFilter">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="ProcessDataMode">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="Always"/>
                <xsd:enumeration value="OnSchedule"/>
                <xsd:enumeration value="ExceptSchedule"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
          <xsd:element name="Schedule" type="PublicSchedulerType" minOccurs="0" maxOccurs="1"/>
          <xsd:choice minOccurs="0" maxOccurs="1">
            <xsd:element name="TimeXPathQuery" type="xsd:string"/>
            <xsd:element name="UseCurrentTime" type="xsd:boolean" default="false"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </Configuration>
  <ModuleImplementation Isolation="Any">
    <Native>
      <ClassID>0D1FB777-4721-4862-A4BE-87138D56207F</ClassID>
    </Native>
  </ModuleImplementation>
  <OutputType>System.BaseData</OutputType>
  <InputTypes>
    <InputType>System.BaseData</InputType>
  </InputTypes>
</ConditionDetectionModuleType>

Parameters

System.SchedulerFilter supports the configuration parameter described in the following table.

Parameter Type Overrideable Description

SchedulerFilter

Complex

False

Required parameter. Specifies the schedule definition as a PublicSchedulerType, the data processing mode, and which data to use as the incoming data item’s timestamp.

SchedulerFilter

Parameter Type Overrideable Description

ProcessDataMode

String

False

Required. Defines how the containing rule or monitor workflow is to use the defined schedule. Contains one of the following values:

  • Always—Not scheduled. The rule or monitor outputs data 24/7.

  • OnSchedule—Scheduled. The rule or monitor outputs data only within the specified schedule.

  • ExceptSchedule—Scheduled. The rule or monitor outputs data only outside the specified schedule.

Schedule

PublicSchedulerType

False

Required parameter unless “Always” is set as the value of the ProcessDataMode parameter. Specifies the schedule definition. For information about how to define the Scheduler parameter, see PublicSchedulerType.

UseCurrentTime

Boolean

False

Required parameter if the TimeXPathQuery parameter is not included. This parameter and the TimeXPathQuery parameter are mutually exclusive. Setting this to true indicates that the generic time parameter of the incoming data item will be used to determine the timestamp of the data item and whether or not it falls within the boundaries of the desired processing schedule.

TimeXPathQuery

String

False

Required parameter if the UserCurrentTime parameter is not included. This parameter and the UserCurrentTime parameter are mutually exclusive. The element must specify a valid XPath value to an incoming data item’s element. The element must contain a valid timestamp value. Use this only when you do not want the data items’ timestamps to be determined by the generic time parameter. The value must be convertible to a standard FileTime value.

Composition

The System.SchedulerFilter module is a native module.

Errors

The errors listed in the following table can occur from within the System.SchedulerFilter module.

Exception Reason

11200

The module failed to initialize.

11201

One or more of the module’s input parameters are not valid.

11202

The module failed to initialize the schedule filter due to a nonvalid process data mode.

11203

The module dropped an incoming data item because it was unable to retrieve its timestamp.

11204

The module was unable to successfully query the incoming data item’s document by using the specified XPath value in the TimeXPathQuery parameter.

11205

The module was unable to convert the TimeXPathQuery date to an appropriate FileTime value.

11206

The module was unable to retrieve an appropriately formatted time parameter value from the incoming data item.

Module Type Usage

System.Discovery.Scheduler

Outputs System.Discovery.Data data on a scheduled, repeating interval. Used in discoveries only.

System.Scheduler

Outputs System.Discovery.Data data on a scheduled, repeating interval.

External Module References

None.

Sample

The following XML sample shows a scheduled rule that processes and returns data between 8:00 AM and 7:00 PM, Monday through Friday. Whenever such an event occurs during the scheduled interval, an alert is generated.

<Rule ID="Microsoft.Samples.ScheduledRule" Enabled="true" Target="Windows!Microsoft.Windows.OperatingSystem" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
  <Category>Alert</Category>
  <DataSources>
    <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
      <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
      <LogName>Application</LogName>
      <Expression>
        <SimpleExpression>
          <ValueExpression>
            <XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
          </ValueExpression>
          <Operator>Equal</Operator>
          <ValueExpression>
            <Value Type="UnsignedInteger">1000</Value>
          </ValueExpression>
        </SimpleExpression>
      </Expression>
    </DataSource>
  </DataSources>
  <ConditionDetection ID="Schedule" TypeID="System!System.SchedulerFilter">
    <SchedulerFilter>
      <ProcessDataMode>OnSchedule</ProcessDataMode>
      <Schedule>
        <WeeklySchedule>
          <Windows>
            <Daily>
              <Start>08:00</Start>
              <End>18:00</End>
              <DaysOfWeekMask>62</DaysOfWeekMask>
            </Daily>
          </Windows>
        </WeeklySchedule>
        <ExcludeDates />
      </Schedule>
      <UseCurrentTime>true</UseCurrentTime>
    </SchedulerFilter>
  </ConditionDetection>
  <WriteActions>
    <WriteAction ID="Alert" TypeID="Health!System.Health.GenerateAlert">
      <Priority>1</Priority>
      <Severity>1</Severity>
      <AlertName />
      <AlertDescription />
      <AlertOwner />
      <AlertMessageId>$MPElement[Name="Microsoft.Samples.ScheduledRule.AlertMessage"]$</AlertMessageId>
      <AlertParameters />
      <Suppression />
    </WriteAction>
  </WriteActions>

Information

   

Module Type

ConditionDetectionModuleType

InputType

System.BaseData

Output Type

System.BaseData

Implementation

Native

Library

System.Library