Creating an Event Consumer Instance

[This is preliminary documentation and subject to change.]

You create event consumers as instances of a given class. This version of WBEM contains a predefined EventViewerConsumer class, which is a subclass of the __EventConsumer system class.

The first procedure describes how to create an event consumer instance. The second and third procedures are intended to work along with the example filters and timers.

    To create an event consumer instance
  1. From the drop-down list box, choose Consumers.
  2. Click the class you want to create an instance, and click the New Instance button.

    —or—

  3. Right-click on the class you want to create an instance, and choose New Instance from the pop-up menu. The Edit new instance properties dialog box appears.

  1. In the Edit new instance properties dialog box, type strings in the Description and Name fields, and type a value in the Severity field.
  2. Click OK to create the instance.
    To create the ServiceStopped event consumer instance

This example defines an instance that, in conjunction with the ServiceStoppedEvent filter, triggers an event notification and displays it in the Event Viewer when a system service is stopped.

  1. From the drop-down list box, choose Consumers.
  2. Click the EventViewerConsumer class, and click the New Instance button.

    —or—

  3. Right-click on the EventViewerConsumer class, and choose New Instance from the pop-up menu. The Edit new instance properties dialog box appears.
  4. In the Edit new instance properties dialog box, type the following:
    1. In the Description field, type Service was stopped.
    2. In the Name field, type ServiceStopped.
    3. In the Severity field, type 1.
  5. Click OK to create the instance.
    To create the TimerEvent event consumer instance

This example defines a consumer that works with IntervalTimerFilter or AbsTimerFilter This triggers an event notification and displays it in the Event Viewer at regular intervals, or at a particular date and time.

  1. From the drop-down list box, choose Consumers.
  2. Click the EventViewerConsumer class, and click the New Instance button.

    —or—

  3. Right-click on the EventViewerConsumer class, and choose New Instance from the pop-up menu. The Edit new instance properties dialog box appears.
  4. In the Edit new instance properties dialog box, type the following:
    1. In the Description field, type TimerEventReceived.
    2. In the Name field, type TimerEvent.
    3. In the Severity field, type 2.
  5. Click OK to create the instance.

Viewing Class Properties

Creating an Event Filter Instance

Creating an Event Timer Instance

Registering a Consumer for an Event

See Also

Event Consumers

__EventConsumer