Huawei Cloud Cloud Monitoring Service CES Basic Introductory Practice
- 1. Introduction to cloud monitoring service CES
- 2. Introduction to this practice
- 3. Purchase Huawei Cloud ECS cloud server
- 4. Monitor ECS elastic cloud host performance
-
- 1. Connect to ECS remotely
- 2. Enter the cloud monitoring service CES page
- 3. Use the cloud monitoring service CES interface
- 4. Install the Agent monitoring plug-in
- 5. Edit the test script
- 6. Execute the test shell script
- 7. Return to the cloud monitoring service CES page
- 8. Shell script to stop ECS running
- 5. Collection of CES indicators
- 6. Actual deployment operations of SMN and CES
1. Introduction to cloud monitoring service CES
Cloud Eye is a monitoring platform for Huawei cloud resources, providing real-time monitoring, timely alarms, resource grouping, site monitoring and other capabilities. Protect your cloud business and be your personal steward of cloud resources.
2. Introduction to this practice
1. Introduction to this practice
This experiment is based on the ECS environment and introduces how to use the cloud monitoring service CES to perform ECS monitoring related operations. Including monitoring of main CPU usage, disk read bandwidth, disk read IOPS, disk write IOPS, inbound bandwidth, outbound bandwidth, inbound traffic, outbound traffic, etc., as well as message notifications on the use of SMN services.
2. Directory of this practice
- Be familiar with Huawei Cloud CES related operations
- Be familiar with the related operations of Huawei Cloud SMN
3. Purchase Huawei Cloud ECS cloud server
1. Enter the ECS cloud server console
In the service list - elastic cloud server
2. Purchase ECS cloud server
- Basic configuration
Choose to purchase an elastic cloud server,
Region: North China - Beijing IV
Billing mode: On-demand billing
Availability Zone: Availability Zone 1
CPU architecture: x86
Specifications: General Computing Enhanced, c7.large.2
Mirror selection: centos7.6 version
The rest of the configuration can be defaulted.
- Network Configuration
Select the default private cloud VPC and security group, or choose to create your own VPC and security group independently.
Flexible public network: Choose to buy now
The rest of the configuration can be freely selected according to your own needs.
- Advanced configuration
Set the login password for the elastic cloud server and leave the rest of the configuration as default.
- Confirm configuration and purchase
Check and confirm the configuration information of ECS and confirm the purchase.
3. Check the status of the ECS elastic cloud host
In ECS Controller, check the ECA elastic cloud host status.
4. Monitor ECS elastic cloud host performance
1. Connect to ECS remotely
Open Terminal through the "Xfce Terminal" on the experimental desktop and connect using the elastic public IP of ECS.
- connection command
LANG=en_us.UTF-8 ssh root@EIP
2. Enter the cloud monitoring service CES page
Service list->"Management and Monitoring"->"Cloud Monitoring Service CES", enter the "Cloud Monitoring Service CES" page
3. Use the cloud monitoring service CES interface
In the monitoring overview interface, check the host monitoring. At this time, it is found that there is no monitoring data. You need to install the Agent monitoring plug-in on the ECS server to display the data.
4. Install the Agent monitoring plug-in
Execute the following command to install the Agent monitoring plug-in.
cd /usr/local && curl -k -O https://obs.cn-north-4.myhuaweicloud.com/uniagent-cn-north-4/script/agent_install.sh && bash agent_install.sh
5. Edit the test script
Enter the following command and shell script in the Xfce terminal.
[root@ecs-67a3 local]# cd ~
[root@ecs-67a3 ~]# vim test.sh
[root@ecs-67a3 ~]# cat test.sh
#/bin/bash
a=1
while true
do
a=$(($a+1))
echo $a
sleep 0.01
done
[root@ecs-67a3 ~]#
6. Execute the test shell script
Execute test shell script
sh test.sh
7. Return to the cloud monitoring service CES page
Wait for 5-10 minutes (it takes a certain amount of time to collect data), return to the "Cloud Monitoring Service CES" page, click on the ECS name to enter the monitoring page.
In the basic monitoring module, you can see the fluctuations in cloud disk read and write, as well as network inlet and outlet traffic and other information.
8. Shell script to stop ECS running
Enter the ctrl+z command in the Xfce terminal to stop the running program.
5. Collection of CES indicators
1.Set alarm rules
On the cloud monitoring service page, click "Alarm Notification" under "Alarm" and click "Create Notification Group"
Enter the group name (the name can be customized) and click OK to create the notification group
2. Create alarm rules
Name: alarm-test
Resource type: Elastic cloud server
ECS dimension: cloud server
Monitoring scope : Specify resources, check the previously created ECS
Trigger rule: Custom creation
Alarm policy: CPU usage, the maximum value is within 5 minutes of the monitoring period> ;=0.5% and for 1 consecutive cycle, the alarm will occur every 5 minutes
Notification method: Notification group Notification group: myecs
Effective time: Default
Trigger condition: Default
After selecting the parameters, click "Create Now" to return to the "Alarm Rules" page, where you can view the created alarm rules.
3. Test trigger alarm
Enter the following command in the Xfce terminal
cd ~
sh test.sh
4. View alarm records
After waiting for 5-10 minutes (it takes a certain amount of time to collect data), return to the "Cloud Monitoring Service CES" page, click "Alarm Rules" under "Alarms", and click "Alarm Record".
5. Stop the program running on ECS
Enter the ctrl+z command in the Xfce terminal to stop the running program
6. Actual deployment operations of SMN and CES
1. Introduction to SMN services
The message notification service (Simple Message Notification) provides users with fast and easy, stable and reliable, simplified operation and maintenance, highly scalable, safe and trustworthy message notification capabilities. End users can receive notification information through HTTP, HTTPS, email, SMS, trigger function execution, instant messaging tools, etc. Huawei Cloud users can also use message notification services to integrate application functions between applications to reduce system complexity.
2. Enter the SMN page
Click on the service list->"Management and Monitoring"->"Message Notification Service SMN" to enter the "Message Notification Service SMN" page
3. Configure SMN email subscription
Click "Topic" under "Topic Management" to add a subscription
Protocol: Email subscription terminal: Customized email address.
4. Check the confirmation email received in your mailbox
The filled-in email will receive a confirmation email, click "Confirm Subscription"
5. Check subscription status
You can check the subscription status on the message notification service page. ,
6. Run the test script
Enter the following command in the Xfce terminal
cd ~
sh test.sh
7.Publish news
On the "Message Notification Service SMN" page, click "Topic" under "Topic Management" and click "Publish Message".
- Configure publishing message content
Message title: cpu (can be customized)
Message type: text message
Message content: cpu alarm (can be customized
8. Check the messages received in your mailbox
After the configuration is completed, click OK to receive the message in the bound mailbox.