3.2.4.8 IAlertDataCollector

The IAlertDataCollector is used to monitor performance counters and to perform actions each time a counter value crosses the given threshold.

The following properties MUST be implemented by the objects that implement the IAlertDataCollector interface.

Property

Read/write

Description

AlertThresholds

RW

List of Performance Counters to monitor, along with the threshold values which are used to generate alerts. The threshold is specified by appending either a '>' or '<' sign along with a value to the Performance Counter path. This defines the threshold to be either greater than or less than the provided value, respectively.

EventLog

RW

Specifies whether or not an event MUST be written to the Eventlog each time the value of any counter specified in the AlertThresholds property. If set to true and the threshold is crossed, then the event will be logged; otherwise, if set to false, and even if the threshold is crossed, the event is not logged. <20>

SampleInterval

RW

The time, in seconds, between two consecutive samples. The default value is 15 seconds. The minimum sample interval is 1 second, and there is no maximum sample interval. However, if the sample interval is set to 0xFFFFFFFF, only one sample will ever be collected.

Task

RW

Name of the Task Scheduler job to be executed each time a Performance Counter value crosses the specified threshold.

TaskArguments

RW

If a task is to run, this specifies the arguments that are passed to it. The arguments need to be formatted as command-line arguments. See section 3.2.4.8.11 for a table of the command line arguments.

TaskRunAsSelf

RW

When a Task Scheduler job is executed by this AlertDataCollector, this property determines which user it runs as. If the property is set to true, the Task Scheduler job runs with the same user credentials as the DataCollectorSet. By default, this means the Task Scheduler job runs with System credentials. Consequently, it is inadvisable to set this property to true when the task to be run is not fully trusted unless the UserAccount property for the DataCollectorSet has been carefully configured. When the property is set to false, the Task Scheduler job runs with the credentials it was created with.

 The mechanism in use here is delegation. When the creator of a data collector set sets this property to true, he or she is granting this task the same rights that the data collector set is running with.

 When the RunAsSelf property is set to false, no delegation occurs. The task will run only with the permissions it was created with. The credentials that the task runs with are initially created with SchRpcRegisterTask specified in [MS-TSCH] section 3.2.5.4.2 and can be updated by SASetAccountInformation specified in [MS-TSCH] section 3.2.5.3.4.

TaskUserTextArguments

RW

If a task is to run and the arguments include the {usertext} variable, this property determines the value of this variable. Any BSTR is potentially a valid value for this property. For example a random string such as "ch&(26D@!k" is a valid value, as are the strings which would normally reference other task arguments, such as "{name}". In no case will only substring contained in the TaskUserTextArguments be expanded (so if the string includes {name}, the string will be passed to the Task with the {name}, not with the value of {name}. The put method for this property will never fail. The actual semantic validity of any particular BSTR depends on the task specified by the Task property.

TriggerDataCollectorSet

RW

Name of the data collector set to be started each time a counter value crosses the threshold.

A data collector can be represented as an XML file, which can be used to serialize (using Xml (Get) 3.2.4.5.21) and deserialize (using SetXml 3.2.4.5.22) it. The format of the XML that defines an alert data collector is as follows (the full XML specification of the data collector set is in section 3.2.4.19):

 <AlertDataCollector>
   <!-- elements for DataCollectorType -->
   <Alert/> 
   <AlertDisplayName/>
   <EventLog/> 
   <SampleInterval/> 
   <Task /> 
   <TaskRunAsSelf/> 
   <TaskArguments /> 
   <TaskUserTextArguments /> 
   <TriggerDataCollectorSet />
 </AlertDataCollector> 
  
  

The format of <Alert> is [performance counter] [<|>] [number]. For example: \Processor(_Total)\% Processor Time>1. See [MSDN-COUNT] for the performance counter path representation.

The example does not show the property elements inherited from IDataCollector that also need to be specified.

Methods in RPC Opnum Order

Method

Description

AlertThresholds (Get)

Retrieves the AlertThresholds property.

Opnum: 32

AlertThresholds (Put)

Sets the AlertThresholds property.

Opnum: 33

EventLog (Get)

Retrieves the EventLog property.

Opnum: 34

EventLog (Put)

Sets the EventLog property.

Opnum: 35

SampleInterval (Get)

Retrieves the SampleInterval property.

Opnum: 36

SampleInterval (Put)

Sets the SampleInterval property.

Opnum: 37

Task (Get)

Retrieves the Task property.

Opnum: 38

Task (Put)

Sets the Task property.

Opnum: 39

TaskRunAsSelf (Get)

Retrieves the TaskRunAsSelf property.

Opnum: 40

TaskRunAsSelf (Put)

Sets the TaskRunAsSelf property.

Opnum: 41

TaskArguments (Get)

Retrieves the TaskArguments property.

Opnum: 42

TaskArguments (Put)

Sets the TaskArguments property.

Opnum: 43

TaskUserTextArguments (Get)

Retrieves the TaskUserTextArguments property.

Opnum: 44

TaskUserTextArguments (Put)

Retrieves the TaskUserTextArguments property.

Opnum: 45

TriggerDataCollectorSet (Get)

Retrieves the TriggerDataCollectorSet property.

Opnum: 46

TriggerDataCollectorSet (Put)

Sets the TriggerDataCollectorSet property.

Opnum: 47

Opnums 0, 1, and 2 are reserved for the IUnknown interface. Opnums 3, 4, 5, and 6 are reserved for the IDispatch interface. Opnums 7–31 are used by IDataCollector.