# Data Object - MetricAlarmExpression(vim.alarm.MetricAlarmExpression)

Extends
  AlarmExpression
See also
  MetricAlarmOperator, PerfMetricId

## Data Object Description

An alarm expression that uses a metric as the condition that triggers an alarm. Base type.

There are two alarm operands: yellow and red. At least one of them must be set. The value of the alarm expression is determined as follows:

- If the host is not connected, the host metric expression is gray.
- If the vm is not connected, the vm metric expression is gray.
- If red is set but yellow is not, the expression is red when the metric is over (isAbove operator) or under (isBelow operator) the red value. Otherwise, the expression is green.
- If yellow is set but red is not, the expression is yellow when the metric is over (isAbove) or under (isBelow) the yellow value. Otherwise, the expression is green.
- If both yellow and red are set, the value of the expression is red when the metric is over (isAbove) or under (isBelow) the red value. Otherwise, the expression is yellow when the metric is over (isAbove) or under (isBelow) the yellow value. Otherwise, the expression is green.

Properties

Name | Type | Description
--- | --- | ---
metric | PerfMetricId | The instance of the metric.
operator | MetricAlarmOperator | The operation to be tested on the metric.
red* | xsd:int | Whether or not to test for a red condition. If not set, do not calculate red status. If set, it contains the threshold value that triggers red status.
redInterval* | xsd:int | Time interval in seconds for which the red condition must be true before the red status is triggered. If unset, the red status is triggered immediately when the red condition becomes true. Since vSphere API 4.0
type | xsd:string | Name of the object type containing the property.
yellow* | xsd:int | Whether or not to test for a yellow condition. If not set, do not calculate yellow status. If set, it contains the threshold value that triggers yellow status.
yellowInterval* | xsd:int | Time interval in seconds for which the yellow condition must be true before the yellow status is triggered. If unset, the yellow status is triggered immediately when the yellow condition becomes true. Since vSphere API 4.0
Properties inherited from AlarmExpression
None
Properties inherited from DynamicData
None

*Need not be set
Show WSDL type definition
<complexType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="MetricAlarmExpression"> <complexContent> <extension base="vsan:AlarmExpression"> <sequence> <element name="operator" type="vsan:MetricAlarmOperator"/> <element name="type" type="xsd:string"/> <element name="metric" type="vsan:PerfMetricId"/> <element name="yellow" type="xsd:int" minOccurs="0"/> <element name="yellowInterval" type="xsd:int" minOccurs="0"/> <element name="red" type="xsd:int" minOccurs="0"/> <element name="redInterval" type="xsd:int" minOccurs="0"/> </sequence> </extension> </complexContent> </complexType>