Share via


Microsoft.Windows.WmiEventProvider

Applies To: Operations Manager 2007 R2

The Microsoft.Windows.WmiEventProvider module is a native data source module type that issues an event-related query to a WMI namespace at a polling interval and returns the results as System.Event.Data type data.

Usage

Use this module to define an event-related WMI query that will subscribe to a particular event-publishing WMI class. This module will continue to receive notifications at the specified interval as WMI events occur. Generally, you will not have to use this module directly because its main function is as a member module that probes for the WMI event data. For example, the Microsoft.Windows.WmiEventProvider.EventProvider module, which contains this module as a member, returns the WMI event data as event type data at a polling interval.

Type Definition

<DataSourceModuleType ID="Microsoft.Windows.WmiEventProvider" Accessibility="Public">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>System!System.ParamListSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="NameSpace" type="xsd:string" />
    <xsd:element name="Query" type="xsd:string" />
    <xsd:element name="PollInterval" type="xsd:integer" />
    <xsd:element name="PropertyIncludes" minOccurs="0" maxOccurs="1" type="OptionalParamListType" />
    <xsd:element name="PropertyExcludes" minOccurs="0" maxOccurs="1" type="OptionalParamListType" />
  </Configuration>
  <ModuleImplementation>
    <Native>
      <ClassID>51BB7C80-E68F-489F-BEBD-8BAFE3128CCE</ClassID>
    </Native>
  </ModuleImplementation>
  <OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>

Parameters

The Microsoft.Windows.WmiEventProvider module supports the configuration parameters described in the following table.

Parameter Type Overrideable Description

Namespace

String

False

Required parameter. Specifies the WMI namespace within which the module is to run the query.

Query

String

False

Required parameter. Specifies the SELECT WMI query to run.

PollInterval

Integer

False

Required parameter. Specifies, in seconds, the polling interval at which to query for events. Must be greater than 0.

PropertyIncludes

OptionalParamListType

False

Optional parameter. Lists the WMI properties to be included in the property bag.

PropertyExcludes

OptionalParamListType

False

Optional parameter. Lists the WMI properties to not be included in the property bag.

For information about the Namespace parameter, see Microsoft.Windows.WmiProbe.

The Query parameter must be a valid WMI event-related query that can be executed against the specified WMI namespace. For more information about how to create WMI event-related queries, see Receiving Event Notifications.

The PropertyIncludes and PropertyExcludes parameters are mutually exclusive and are used to limit the amount of WMI properties you want to include or exclude in the property bag.

Composition

The Microsoft.Windows.WmiEventProvider module is a native module.

The module connects to the specified WMI namespace by calling IWbemLocator::ConnectServer. If the connection succeeds, it receives a pointer to the IWbemServices interface and calls IWbemServices::ExecNotificationQuery to run the query. The module continues to poll for new events at the specified polling interval.

Errors

The errors listed in the following table can occur from within the Microsoft.Windows.WmiEventProvider module.

Exception Reason

10353

The module failed to connect to the WMI namespace.

10357

The module failed to issue the event-related query and will not able to receive events.

10359

The module was unable to create a property bag data item from the WMI object data.

10361

The module was unable to output a data item.

10363

The module was unable to enumerate the WMI data.

10365

The module cannot initialize due to wrong configuration parameter data.

10366

The module was unable to convert the input namespace to a local namespace.

10367

The polling interval is less than 1.

10368

A large array was returned from the WMI object. This might indicate a misconfigured module.

None.

External Module References

The Microsoft.Windows.WmiEventProvider module is a member of the module described in the following table.

Module Type Library Usage

Microsoft.Windows.WmiEventProvider.EventProvider

Microsoft.Windows.Library

Issues an event-related query to a WMI namespace at a polling interval and returns the results as System.Event.Data type data.

Sample

The following XML sample illustrates how the Microsoft.Windows.WmiEventProvider probe action module type is used in a DataSourceModuleType definition.

<DataSourceModuleType ID="Microsoft.Windows.WmiEventProvider.FilteredEventProvider" Accessibility="Public">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="NameSpace" type="xsd:string" />
    <xsd:element name="Query" type="xsd:string" />
    <xsd:element name="PollInterval" type="xsd:integer" />
    <xsd:element name="Expression" type="ExpressionType" />
  </Configuration>
  <ModuleImplementation>
    <Composite>
      <MemberModules>
        <DataSource TypeID="Microsoft.Windows.WmiEventProvider" ID="DataSource">
          <NameSpace>$Config/NameSpace$</NameSpace>
          <Query>$Config/Query$</Query>
          <PollInterval>$Config/PollInterval$</PollInterval>
        </DataSource>
        <ConditionDetection TypeID="System!System.ExpressionFilter" ID="Filter">
          <Expression>$Config/Expression$</Expression>
        </ConditionDetection>
        <ConditionDetection TypeID="System!System.Event.GenericDataMapper" ID="Mapper">
          <EventOriginId>$Target/Id$</EventOriginId>
          <PublisherId>$MPElement$</PublisherId>
          <PublisherName>WmiEventProvider</PublisherName>
          <Channel>WmiEventProvider</Channel>
          <LoggingComputer />
          <EventNumber>0</EventNumber>
          <EventCategory>3</EventCategory>
          <EventLevel>0</EventLevel>
          <UserName />
          <Params />
        </ConditionDetection>
      </MemberModules>
      <Composition>
        <Node ID="Mapper">
          <Node ID="Filter">
            <Node ID="DataSource" />
          </Node>
        </Node>
      </Composition>
    </Composite>
  </ModuleImplementation>
  <OutputType>System!System.Event.Data</OutputType>
</DataSourceModuleType>

Information

   

Module Type

DataSourceModuleType

Input Type

None

Output Type

System.PropertyBagData

Implementation

Native

Library

Microsoft.Windows.Library