Monitoring custom metrics using CloudWatch
This section will show how to install the CloudWatch agent to monitor custom metrics (memory and disk utilization). To achieve this, we need to follow a series of steps.
Downloading and installing the CloudWatch agent
Firstly, we need to download and install the CloudWatch agent package. To do so, we perform the following steps:
- Log in to the EC2 instance by running the following command with your details filled in:
ssh -i vpc-prod.pem ec2-user@<server public ip>
- Download the CloudWatch agent with the following command:
wget https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
- Install the CloudWatch agent using the following command:
sudo rpm -ivh amazon-cloudwatch-agent.rpm Preparing...                          #########################...