All Products
Search
Document Center

Auto Scaling:DescribeAlarms

Last Updated:Mar 24, 2025

Queries event-triggered tasks. You can call the DescribeAlarms operation to learn about the configurations of event-triggered tasks and keep updated on monitoring data changes. This helps you troubleshoot system resource issues at the earliest opportunity and ensures system stability and reliability.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

DescribeAlarms

The operation that you want to perform. Set the value to DescribeAlarms.

RegionId

String

Yes

cn-qingdao

The region ID of the event-triggered task.

ScalingGroupId

String

No

asg-bp18p2yfxow2dloq****

The ID of the scaling group that is monitored by the event-triggered task.

AlarmTaskId

String

No

asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****

The ID of the event-triggered task.

State

String

No

OK

The status of the event-triggered task. Valid values:

  • ALARM: The alert condition is met and an alert is triggered.

  • OK: The alert condition is not met.

  • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.

IsEnable

Boolean

No

true

Specifies whether to enable the event-triggered task feature. Valid values:

  • true: enables the event-triggered task feature.

  • false: disables the event-triggered task feature.

MetricType

String

No

system

The type of the metric used by the event-triggered task. Valid values:

  • system: system metrics of CloudMonitor.

  • custom: custom metrics that are reported to CloudMonitor

MetricName

String

No

CpuUtilization

The metric name.

PageSize

Integer

No

10

The number of entries per page. Maximum value: 50.

Default value: 10.

PageNumber

Integer

No

1

The page number. Minimum value: 1.

Default value: 1.

Response parameters

Parameter

Type

Example

Description

PageSize

Integer

10

The number of entries per page.

RequestId

String

871C7C53-34A4-45AA-8C14-4B72FA6A****

The request ID.

PageNumber

Integer

1

The page number.

TotalCount

Integer

2

The total number of event-triggered tasks.

AlarmList

Array of Alarm

The event-triggered tasks.

Alarm

AlarmTaskId

String

asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****

The ID of the event-triggered task.

MetricName

String

CpuUtilization

The metric name. Valid values:

  • CpuUtilization (ECS): the CPU utilization. Unit: %.

  • ConcurrentConnections (ECS): the number of concurrent connections.

  • IntranetTx (ECS): the outbound traffic over an internal network. Unit: KB/min.

  • IntranetRx (ECS): the inbound traffic over an internal network. Unit: KB/min.

  • VpcInternetTx (ECS): the outbound traffic over a virtual private cloud (VPC). Unit: KB/min.

  • VpcInternetRx (ECS): the inbound traffic over a VPC. Unit: KB/min.

  • SystemDiskReadBps (ECS): the number of bytes read from the system disk per second.

  • SystemDiskWriteBps (ECS): the number of bytes written to the system disk per second.

  • SystemDiskReadOps (ECS): the read IOPS of the system disk. Unit: counts/s.

  • SystemDiskWriteOps (ECS): the write IOPS of the system disk. Unit: counts/s.

  • CpuUtilizationAgent (Agent): the CPU utilization. Unit: %.

  • GpuUtilizationAgent (Agent): the GPU utilization. Unit: %.

  • GpuMemoryFreeUtilizationAgent (Agent): the idle GPU memory usage. Unit: %.

  • GpuMemoryUtilizationAgent (Agent): the GPU memory usage. Unit: %.

  • MemoryUtilization (Agent): the memory usage. Unit: %.

  • LoadAverage (Agent): the average system load of an agent.

  • TcpConnection (Agent): the total number of TCP connections.

  • TcpConnection (Agent): the number of established TCP connections.

  • PackagesNetOut (Agent): the number of packets sent by the internal network interface card (NIC). Unit: counts/s.

  • PackagesNetIn (Agent): the number of packets received by the internal NIC. Unit: counts/s.

  • PackagesNetOut (Agent): the number of packets sent by the public NIC. Unit: counts/s.

  • PackagesNetIn (Agent): the number of packets that are received by the public NIC.

  • EciPodCpuUtilization: the CPU utilization. Unit: %.

  • EciPodMemoryUtilization: the memory usage. Unit: %.

  • LoadBalancerRealServerAverageQps (ALB): the queries per second (QPS).

For more information, see Event-triggered task for system monitoring.

EvaluationCount

Integer

3

The number of times that the threshold must be reached before a scaling rule is executed. For example, if you set this parameter to 3, the average CPU utilization must reach 80% three times in a row before a scaling rule is executed.

State

String

ALARM

The status of the event-triggered task. Valid values:

  • ALARM: The alert condition is met and an alert is triggered.

  • OK: The alert condition is not met.

  • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.

Period

Integer

300

The statistical period of the metric data. Unit: seconds. Valid values:

  • 15

  • 60

  • 120

  • 300

  • 900

Note

You can set this parameter to 15 seconds only for scaling groups of the ECS type.

ScalingGroupId

String

asg-bp18p2yfxow2dloq****

The ID of the scaling group that is monitored by the event-triggered task.

ComparisonOperator

String

>=

The operator that is used to compare the metric value and the metric threshold.

  • Valid value if the metric value is greater than or equal to the threshold: >=.

  • Valid value if the metric value is less than or equal to the threshold: <=.

  • Valid value if the metric value is greater than the threshold: >.

  • Valid value if the metric value is less than the threshold: <.

Effective

String

* * * * * ?

The period during which the event-triggered task is in effect.

Description

String

Test alarm task.

The description of the event-triggered task.

MetricType

String

system

The metric type. Valid values:

  • system: system metrics of CloudMonitor.

  • custom: custom metrics that are reported to CloudMonitor

Name

String

TestAlarmTask

The name of the event-triggered task.

Threshold

Float

80.0

The threshold of the metric value. If the threshold is reached the specified number of times within the specified period, a scaling rule is executed.

Enable

Boolean

true

Indicates whether the event-triggered task feature is enabled. Valid values:

  • true: The event-triggered task feature is enabled.

  • false: The event-triggered task feature is disabled.

Statistics

String

Average

The statistical method of the metric data. Unit: seconds. Valid values:

  • Average

  • Minimum

  • Maximum

Dimensions

Array of Dimension

The dimensions of the metric.

Dimension

DimensionKey

String

device

The dimension key of the metric. Valid values:

  • user_id: the ID of your Alibaba Cloud account.

  • scaling_group: the scaling group that is monitored.

  • device: the type of the NIC.

  • state: the status of the TCP connection

DimensionValue

String

eth0

The dimension value of the metric. The value of this parameter varies based on the value of DimensionKey.

  • user_id: The system specifies the value.

  • scaling_group: The system specifies the value.

  • Valid values for device:

    • eth0: the internal NIC for instances that reside in the classic network. Only one eth0 NIC exists on each instance of the VPC type.

    • eth1: the public NIC for instances that reside in the classic network.

Valid values for state:

  • TCP_TOTAL: the total number of TCP connections.

  • ESTABLISHED: the number of TCP connections that are established.

AlarmActions

Array of String

ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****

The unique identifiers of the scaling rules that are associated with the event-triggered tasks.

Expressions

Array of Expression

The expressions defined in the multi-metric alert rule.

Expression

MetricName

String

CpuUtilization

The names of the metrics in the multi-metric alert rule. Valid values:

  • CpuUtilization (ECS): the CPU utilization. Unit: %.

  • ConcurrentConnections (ECS): the number of concurrent connections.

  • IntranetTx (ECS): the outbound traffic over an internal network. Unit: KB/min.

  • IntranetRx (ECS): the inbound traffic over an internal network. Unit: KB/min.

  • VpcInternetTx (ECS): the outbound traffic over a VPC. Unit: KB/min.

  • VpcInternetRx (ECS): the inbound traffic over a VPC. Unit: KB/min.

  • SystemDiskReadBps (ECS): the number of bytes read from the system disk per second.

  • SystemDiskWriteBps (ECS): the number of bytes written to the system disk per second.

  • SystemDiskReadOps (ECS): the read IOPS of the system disk. Unit: counts/s.

  • SystemDiskWriteOps (ECS): the write IOPS of the system disk. Unit: counts/s.

  • CpuUtilizationAgent (Agent): the CPU utilization. Unit: %.

  • GpuUtilizationAgent (Agent): the GPU utilization. Unit: %.

  • GpuMemoryFreeUtilizationAgent (Agent): the idle GPU memory usage. Unit: %.

  • GpuMemoryUtilizationAgent (Agent): the GPU memory usage. Unit: %.

  • MemoryUtilization (Agent): the memory usage. Unit: %.

  • LoadAverage (Agent): the average system load of an agent.

  • TcpConnection (Agent): the total number of TCP connections.

  • TcpConnection (Agent): the number of established TCP connections.

  • PackagesNetOut: the number of packets sent by the internal NIC. Unit: counts/s.

  • PackagesNetIn: the number of packets received by the internal NIC. Unit: counts/s.

  • PackagesNetOut: the number of packets sent by the public NIC. Unit: counts/s.

  • PackagesNetIn (Agent): the number of packets that are received by the public NIC.

  • EciPodCpuUtilization: the CPU utilization. Unit: %.

  • EciPodMemoryUtilization: the memory usage. Unit: %.

  • LoadBalancerRealServerAverageQps (ALB): the QPS.

For more information, see Event-triggered task for system monitoring.

ComparisonOperator

String

>=

The operator that is used to compare the metric value and the threshold.

  • Valid value if the metric value is greater than or equal to the threshold: >=.

  • Valid value if the metric value is less than or equal to the threshold: <=.

  • Valid value if the metric value is greater than the threshold: >.

  • Valid value if the metric value is less than the threshold: <.

Default value: >=.

Period

Integer

900

The statistical period of the metric data in the multi-metric alert rule. Unit: seconds. Valid values:

  • 15

  • 60

  • 120

  • 300

  • 900

Note

You can set this parameter to 15 seconds only for scaling groups of the ECS type.

Statistics

String

Average

The statistical method of the metric data in the multi-metric alert rule. Valid values:

  • Average

  • Minimum

  • Maximum

Threshold

Float

40.0

The thresholds of the metric values in the multi-metric alert rule. If the thresholds are reached the specified number of times within the statistical period, a scaling rule is executed.

ExpressionsLogicOperator

String

&&

The alert triggering logic of the multi-metric alert rule. Valid values:

  • &&: An alert is triggered only if all metrics in the multi-metric alert rule meet their trigger conditions. In this case, an alert is triggered only if the results of all trigger conditions that are specified in the multi-metric alert rule are true.

  • ||: An alert is triggered only if one of the metrics in the multi-metric alert rule meets its trigger condition.

HybridMonitorNamespace

String

aliyun-test

The ID of the Hybrid Cloud Monitoring namespace.

For information about how to manage Hybrid Cloud Monitoring namespaces, see Manage namespaces.

HybridMetrics

Array of HybridMetric

The Hybrid Cloud Monitoring metrics. For more information, see Create a custom target tracking scaling rule.

HybridMetric

Id

String

a

The reference ID of the metric in the metric expression.

Expression

String

(a+b)/2

The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events.

The expression is written in Reverse Polish Notation (RPN) format and includes only the following operators: +, -, *, /.

MetricName

String

AliyunSmq_NumberOfMessagesVisible

The name of the Hybrid Cloud Monitoring metric.

Statistic

String

Average

The statistical method of the metric value. Valid values:

  • Average

  • Minimum

  • Maximum

Dimensions

Array of Dimension

The metric dimensions. You can use this parameter to specify the monitored resources.

Dimension

DimensionKey

String

queue

The dimension key of the metric.

DimensionValue

String

testQueue

The dimension value of the metric.

PromQL

String

(avg(last_over_time(AliyunMnsnew_ActiveMessages{region='cn-hangzhou',userId='123456****',queue='testQueue'}[900s])) by (userId))/(avg(last_over_time(AliyunEss_RunningInstanceCount{instanceId='asg-bp1****'}[900s])) by (userId) != 0)

The PromQL statement of Hybrid Cloud Monitoring.

Examples

Sample requests

http(s)://ess.aliyuncs.com/?Action=DescribeAlarms
&RegionId=cn-qingdao
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&AlarmTaskId=asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****
&State=OK
&IsEnable=true
&MetricType=system
&MetricName=CpuUtilization
&PageSize=10
&PageNumber=1
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeAlarmsResponse>
    <PageSize>10</PageSize>
    <RequestId>871C7C53-34A4-45AA-8C14-4B72FA6A****</RequestId>
    <PageNumber>1</PageNumber>
    <TotalCount>2</TotalCount>
    <AlarmList>
        <AlarmTaskId>asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****</AlarmTaskId>
        <MetricName>CpuUtilization</MetricName>
        <EvaluationCount>3</EvaluationCount>
        <State>ALARM</State>
        <Period>300</Period>
        <ScalingGroupId>asg-bp18p2yfxow2dloq****</ScalingGroupId>
        <ComparisonOperator>&gt;=</ComparisonOperator>
        <Effective>* * * * * ?</Effective>
        <Description>Test alarm task.</Description>
        <MetricType>system</MetricType>
        <Name>TestAlarmTask</Name>
        <Threshold>80</Threshold>
        <Enable>true</Enable>
        <Statistics>Average</Statistics>
        <Dimensions>
            <DimensionKey>device</DimensionKey>
            <DimensionValue>eth0</DimensionValue>
        </Dimensions>
        <AlarmActions>ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****</AlarmActions>
        <Expressions>
            <MetricName>CpuUtilization</MetricName>
            <ComparisonOperator>&gt;=</ComparisonOperator>
            <Period>900</Period>
            <Statistics>Average</Statistics>
            <Threshold>40</Threshold>
        </Expressions>
        <ExpressionsLogicOperator>&amp;&amp;</ExpressionsLogicOperator>
    </AlarmList>
</DescribeAlarmsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PageSize" : 10,
  "RequestId" : "871C7C53-34A4-45AA-8C14-4B72FA6A****",
  "PageNumber" : 1,
  "TotalCount" : 2,
  "AlarmList" : [ {
    "AlarmTaskId" : "asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****",
    "MetricName" : "CpuUtilization",
    "EvaluationCount" : 3,
    "State" : "ALARM",
    "Period" : 300,
    "ScalingGroupId" : "asg-bp18p2yfxow2dloq****",
    "ComparisonOperator" : ">=",
    "Effective" : "* * * * * ?",
    "Description" : "Test alarm task.",
    "MetricType" : "system",
    "Name" : "TestAlarmTask",
    "Threshold" : 80,
    "Enable" : true,
    "Statistics" : "Average",
    "Dimensions" : [ {
      "DimensionKey" : "device",
      "DimensionValue" : "eth0"
    } ],
    "AlarmActions" : [ "ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****" ],
    "Expressions" : [ {
      "MetricName" : "CpuUtilization",
      "ComparisonOperator" : ">=",
      "Period" : 900,
      "Statistics" : "Average",
      "Threshold" : 40
    } ],
    "ExpressionsLogicOperator" : "&&"
  } ]
}

Error codes

For a list of error codes, see Service error codes.