WriteAction (Recovery)

Applies To: Operations Manager 2007 R2, System Center Operations Manager 2007

Represents an implementation of a write action module type definition.

Schema Hierarchy

ManagementPack
  Monitoring
    Recoveries
      Recovery
        WriteAction (Recovery)

Syntax

<WriteAction ID=”ModuleID” Comment=”Comment” TypeID=”ModuleTypeID”>
Custom Schema Defined Parameters
</WriteAction>

Attributes and Elements

The following sections describe attributes, child elements, and the parent element of the WriteAction element.

Attributes

Attribute Description

ID

Required attribute. Represents the identity of the element.

Comment

Optional attribute. Represents commentary by the management pack author.

TypeID

Required attribute. Represents the WriteAction module type definition from which this WriteAction module inherits its configuration schema.

ID Attribute Values

Value Description

The format for the ID attribute should be UniqueElementID.

The ID string must contain the following characteristics:

  • The length is less than 255 characters.

  • The ID begins with a letter (a-z) or a number (0-9).

  • The ID contains only letters, numbers, the period character (.), or the underscore (_) character.

  • The ID is unique across all elements within the scope of the WriteAction module’s containing workflow.

  • The ID is case-sensitive.

Child Elements

The child element of the WriteAction module is defined by the configuration schema of its base type as referenced in the TypeID attribute.

Parent Elements

Element Description

Recovery

Represents a recovery definition associated with a specific monitor.

Remarks

A WriteAction module takes a single input data stream. It uses this data stream, perhaps in conjunction with some kind of condition detection, to affect system state in some way. This change could be in the monitored system or in Operations Manager itself. For example, a write action module might run a script that changes something, writes data into the Operations Manager database, or generates an alert. 

A write action module’s base type must always be a descendant of a WriteActionModuleType element. Write action modules are used only at the end of a workflow because they do not return a data for processing to another module. When they do return data, they do so only so that it can be sent to the Operations database or sent to standard output.

Recoveries always contain write action modules because they affect system state in some way.

Example

The following XML sample illustrates a recovery that restarts a service when the Microsoft.Windows.HyperV.2008.Services.ImageManagementServiceMonitor monitor reaches an Error health state.

<Recovery ID="Microsoft.Windows.HyperV.2008.Services.ImageManagementServiceRestart" Accessibility="Internal" Enabled="True" Target="HVDisc!Microsoft.Windows.HyperV.2008.ServerRole" Monitor="Microsoft.Windows.HyperV.2008.Services.ImageManagementServiceMonitor" ResetMonitor="false" ExecuteOnState="Error" Remotable="true" Timeout="300">
  <Category>Maintenance</Category>
  <WriteAction ID="RestartService" TypeID="Windows!Microsoft.Windows.ServiceControlManager.StartService" RunAs="System!System.PrivilegedMonitoringAccount">
    <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
    <ServiceName>vhdsvc</ServiceName>
  </WriteAction>
</Recovery>

See Also

Reference

Recovery
WriteActionModuleType