All Products
Search
Document Center

Auto Scaling:DescribeAlarms

Last Updated:Feb 29, 2024

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 the Event-triggered Task feature is enabled. Valid values:

  • true

  • false

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. Page numbers start from 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: the CPU utilization. Unit: %.

  • ConcurrentConnections: the number of concurrent connections.

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

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

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

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

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

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

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

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

  • CpuUtilizationAgent: the CPU utilization. Unit: %.

  • GpuUtilizationAgent: the GPU utilization. Unit: %.

  • GpuMemoryFreeUtilizationAgent: the idle GPU memory usage. Unit: %.

  • GpuMemoryUtilizationAgent: the GPU memory usage. Unit: %.

  • MemoryUtilization: the memory usage. Unit: %.

  • LoadAverage: the average system load.

  • TcpConnection: the total number of TCP connections.

  • TcpConnection: the number of established TCP connections.

  • PackagesNetOut: the number of packets sent by the internal network interface controller (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: the number of packets received by the public NIC. Unit: counts/s.

  • EciPodCpuUtilization: the CPU utilization. Unit: %.

  • EciPodMemoryUtilization: the memory usage. Unit: %.

  • LoadBalancerRealServerAverageQps: the queries per second (QPS) of an instance.

For more information, see Event-triggered tasks of the system monitoring type.

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 Elastic Compute Service (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 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

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

  • false

Statistics

String

Average

The method that is used to collect statistics about the metric. 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 that resides in VPCs.

    • 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: the CPU utilization. Unit: %.

  • ConcurrentConnections: the number of concurrent connections.

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

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

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

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

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

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

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

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

  • CpuUtilizationAgent: the CPU utilization. Unit: %.

  • GpuUtilizationAgent: the GPU utilization. Unit: %.

  • GpuMemoryFreeUtilizationAgent: the idle GPU memory usage of an agent. Unit: %.

  • GpuMemoryUtilizationAgent: the GPU memory usage. Unit: %.

  • MemoryUtilization: the memory usage. Unit: %.

  • LoadAverage: the average system load.

  • TcpConnection: the total number of TCP connections.

  • TcpConnection: 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: the number of packets received by the public NIC. Unit: counts/s.

  • EciPodCpuUtilization: the CPU utilization. Unit: %.

  • EciPodMemoryUtilization: the memory usage. Unit: %.

  • LoadBalancerRealServerAverageQps: the QPS of an instance.

For more information, see Event-triggered tasks of the system monitoring type.

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 period of time during which statistics about the metrics in the multi-metric alert rule is collected. 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 method that is used to collect statistics about the metrics 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 relationship between the trigger conditions that are specified in the multi-metric alert rule. Valid values:

  • &&: An alert is triggered only if all metrics in the multi-metric alert rule meet the trigger conditions. That is, an alert is triggered only if the results of all expressions defined 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.

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.