DEV Community

Cover image for AWS CloudWatch.
Maxwell Wokocha C.
Maxwell Wokocha C.

Posted on

AWS CloudWatch.

In real systems, CloudWatch answers one key question:

“Is my system healthy right now?”

CloudWatch does this using four core components:

. Metrics – numeric data over time
(CPU usage, memory, network traffic)

. Logs – detailed event records
(application logs, system logs, errors)

. Alarms – automated responses
(send alerts when thresholds are crossed)

. Dashboards – operational visibility
(a single screen showing system health)

If your system is running in production and CloudWatch is not configured, you are flying blind.

CloudWatch (Monitoring & Alerts)

LAB 1: Monitor EC2 CPU

. Launch an EC2 Instance.

. Name Instance, Choose AMI And Create Key Pair.






LAB 2: Go To CloudWatch And Set CPU Utilization.

. Go To Metrics, Choose All Metrics.

. Choose EC2 In The Metrics, Then Per-Instance Metrics Because It's Our Area Of Concentration.

. Choose CPU Utilization.

LAB 3. Configure an SNS(Simple Notification Service) Topic (Alert Channel)

. Name Alert.

. Choose The Type As Standard And Take The Default In The Other Settings Then Create Topic.

LAB 4: Subscribe Your Email.

. In The Page Of The Created Topic, Choose Create Subscription.

. Set Up Email And Create Subscription.

LAB 5: Create a CloudWatch Alarm.

. Go To Cloudwatch.

. In Cloudwatch, Go To Alarm And Choose All Alarms.

. Create Alarm.

. Select Metrics.

. Select EC2.

. Select Per-Instance Metrics.

. Select The Correct Name Of Your Instance And Select CPU Utilization Then Select Metrics.

LAB 6: Set Threshold/Conditions.

. Select Notification Then Next.

. Name Alarm Then Next.

. Create Alarm.

. Go To Your Email And Confirm The Subscription.

Let's Stress The CPU And See If We Get A Notification In The Email.

. Go To The Instance And Install Something To Stress The CPU. Run The Following Command: sudo yum install stress -y,
stress --cpu 2 --timeout 300


. Email Notification.

Top comments (0)