You can report custom monitoring data to Hybrid Cloud Monitoring. Then, you can view the monitoring charts of specified metrics on the dashboard.
Prerequisites
Hybrid Cloud Monitoring is activated. For more information, see Activate Hybrid Cloud Monitoring.Background information
You are not charged for activating Hybrid Cloud Monitoring. You are charged based on the amount of resources that you consume. For more information, see Billing of the dashboard feature.
Procedure
- Install Alibaba Cloud CLI on the server where the custom monitoring data resides.
For more information, see Windows, Linux, or Install Alibaba Cloud CLI on macOS.
You can run the aliyun version command to check whether Alibaba Cloud CLI is installed. If the command output shows the current version of Alibaba Cloud CLI, Alibaba Cloud CLI is installed.
- Configure the AccessKey pair of the Alibaba Cloud account or RAM user on the server where the custom monitoring data resides.
For more information about how to obtain the AccessKey pair of the Alibaba Cloud account or a RAM user, see Obtain an AccessKey pair.
For more information about how to configure an AccessKey pair, see Configure an AccessKey credential.
If the following information is displayed, the AccessKey pair is configured.Configure Done!!! ..............888888888888888888888 ........=8888888888888888888D=.............. ...........88888888888888888888888 ..........D8888888888888888888888I........... .........,8888888888888ZI: ...........................=Z88D8888888888D.......... .........+88888888 ..........................................88888888D.......... .........+88888888 .......Welcome to use Alibaba Cloud.......O8888888D.......... .........+88888888 ............. ************* ..............O8888888D.......... .........+88888888 .... Command Line Interface(Reloaded) ....O8888888D.......... .........+88888888...........................................88888888D.......... ..........D888888888888DO+. ..........................?ND888888888888D.......... ...........O8888888888888888888888...........D8888888888888888888888=........... ............ .:D8888888888888888888.........78888888888888888888O ..............
- Create a namespace in the CloudMonitor console.
- Report custom monitoring data to Hybrid Cloud Monitoring.
- Report the data of a single metric
aliyun cms PutHybridMonitorMetricData --region cn-hangzhou --MetricList.1.Name CPU_Usage --MetricList.1.Labels.1.Key=IP --MetricList.1.Labels.1.Value=192.168.XX.XX --MetricList.1.Value 90 --Namespace 'default-aliyun'
- Report the data of multiple metrics
aliyun cms PutHybridMonitorMetricData --region cn-hangzhou --MetricList.1.Name CPU_Usage --MetricList.1.Labels.1.Key=IP --MetricList.1.Labels.1.Value=192.168.XX.XX --MetricList.1.Labels.2.Key=IP --MetricList.1.Labels.2.Value=192.168.XX.XX --MetricList.1.Value 90 --Namespace 'default-aliyun'
- Report the data of a single metric
- View the custom monitoring data in the CloudMonitor console.