All Products
Search
Document Center

Cloud Monitor:Report monitoring data by using Alibaba Cloud CLI

Last Updated:Jun 16, 2026

You can report custom monitoring data to Cloud Monitor by using Alibaba Cloud CLI.

Grant permissions on Cloud Monitor to a RAM user

You can use an Alibaba Cloud account or a Resource Access Management (RAM) user to report monitoring data. If a RAM user uses an AccessKey pair to report monitoring data, grant Cloud Monitor permissions to the RAM user:
  1. Log on to the RAM console with an Alibaba Cloud account.
  2. Create a RAM user.

    For more information, see Create a RAM user.

  3. Create an AccessKey pair for the RAM user.

    For more information, see Create an AccessKey.

  4. Attach the AliyunCloudMonitorFullAccess policy to the RAM user.

    For more information, see Manage RAM user permissions.

Install and configure Alibaba Cloud CLI

For more information, see Install Alibaba Cloud CLI in Windows or Install Alibaba Cloud CLI in Linux.

Report monitoring data

Call the PutCustomMetric operation to report monitoring data. For more information, see PutCustomMetric.

Sample command:

aliyun cms PutCustomMetric  --MetricList.1.MetricName cpu_total --MetricList.1.Dimensions '{"sampleName1":"value1","sampleName2":"value2"}' --MetricList.1.Time 1555390981421 --MetricList.1.Type 0 --MetricList.1.Period 60 --MetricList.1.Values '{"value":10.5}' --MetricList.1.GroupId "0"

A status code 200 indicates that the monitoring data is reported.

{
  "Message": "success",
  "RequestId": "F69F5623-DDD6-42AE-AE59-87A2B841620B",
  "Code": "200"
}

Status codes

The following table lists the status codes that Cloud Monitor may return when you report monitoring data.
Status code Description
200 The monitoring data is reported.
206
  • If the error message is ''reach Max time series num'', the time series quota is exhausted. Purchase a higher quota or remove unnecessary time series.
  • If the error message is ''not allowed original value, please upgrade service'', the free edition of Cloud Monitor does not support reporting raw data. Upgrade your Cloud Monitor edition.
  • If the error message is ''type is invalid'', the Type parameter value is invalid. Set this parameter to 0 or 1.
400 The request contains a syntax error.
403 Verification failed, the rate reached the throttling threshold, or the required permission is missing.
500 An internal server error occurred.