resolve-alert operation

The resolve-alert operation resolves alerts that are filtered by the specified search criterion.

The following table describes the <items> XML and request elements for the resolve-alert operation:

Adapter request elements for the resolve-alert operation

Element

Definition

Required

<operation-name>

Specifies the operation name: resolve-alert

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert>

Specifies the search criterion to retrieve the alerts that you want to resolve

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

No

<criteria-expression>

Specifies the parent element for a single search criterion

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Conditional; required if the <alert-search-criteria> element is specified

<key>

Specifies the alert attribute used in the search

Valid values: Any valid alert attribute. For example, name, description, and ID.

Note

You can use the find-alert-by-id operation to retrieve all the available alert attributes.

Conditional; required if the <alert-search-criteria> element is specified

<value>

Specifies the value of the attribute specified in the <key> element

Conditional; required if the <alert-search-criteria> element is specified

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements.

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key> and <value> elements.

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Conditional; required if the <alert-search-criteria> element is specified

<resolve-alert-comment>

Specifies a comment to associate with the resolved alert

No

<preview>

Specifies whether you want to preview the results of the operation

Valid values:

  • true: Indicates that you want to preview the results of the operation
  • false: Indicates that the operation is executed without displaying the results of the execution (default)

No

The following figure illustrates a sample adapter request for the resolve-alert operation:

Sample adapter request for the resolve-alert operation

<scom-request>
  <operation-name>resolve-alert</operation-name>
  <command-request>
    <timeout-secs>120</timeout-secs>
    <command-parameters>
      <alert>
        <alert-search-criteria>
          <criteria-expression>
            <key>TicketId</key>
            <value>ABC-1002</value>
            <operator>equals</operator>
          </criteria-expression>
        </alert-search-criteria>
      </alert>
      <comment>
        <resolve-alert-comment>Resolving Alert</resolve-alert-comment>
      </comment>
      <preview>true</preview>
    </command-parameters>
  </command-request>
</scom-request>



The following figure illustrates the adapter response for the sample request:

Sample adapter response for the resolve-alert operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command>./Microsoft.EnterpriseManagement.OperationsManager.ClientShell.
        Startup.ps1;(get-alert -criteria {TicketId = 'ABC-1002'}) | resolve-alert
         -comment 'Resolving Alert' -whatif</command>
        <execution-milliseconds>4375</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>0</count>
      </metadata>
      <output>
        <line>What if: Performing operation "Resolve-Alert" on Target "4c392087-
        6b0d-4e70-9270-6ccf29a79b36".</line>
      </output>
    </command-output>
  </commands-output>
</scom-response>
Was this page helpful? Yes No Submitting... Thank you

Comments