Module 3: CloudWatch Dashboard Assignment
Problem Statement: You work for XYZ Corporation. To maintain the security of the AWS account and the resources you have been asked to implement a solution that can help easily recognize and monitor the different users. Also, you will be monitoring the machines created by these users for any errors or misconfigurations.
Tasks To Be Performed:
- Create a dashboard which lets you check the CPU utilization and networking for a particular EC2 instance.
-
Preparation:
- I first ensured that I had two EC2 instances running:
instance1
andinstance2
.
- I first ensured that I had two EC2 instances running:
-
Building My Dashboard:
- I logged into AWS and went straight to CloudWatch.
- On the left side, I clicked on
Dashboards
and then hitCreate Dashboard
. - I gave my dashboard the name
EC2s
and clickedCreate dashboard
-
Populating the Dashboard with Widgets:
- Inside my new dashboard I get prompted to
Add widget
. - I chose the
Line
widget because it visually made the most sense for what I wanted. - Under
Metrics
, I navigated toEC2 -> Per-Instance Metrics
. - I selected
CPUUtilization
and then filtered by my EC2 instance’s ID or name for accuracy. - For networking, I picked metrics like
NetworkPacketsIn
andNetworkPacketsOut
. Again, I made sure to filter by my EC2 instance.
Here I pickedInstance1
will repeat steps forInstance2
- Once I added all my metrics, I clicked
Create widget
. - The result is a dashboard with 2 widgets for
Instance1
andInstance2
- Inside my new dashboard I get prompted to
-
Saving My Work:
- I was happy with how everything looked, so I clicked
Save dashboard
.
- I was happy with how everything looked, so I clicked
-
Simulating Load on
Instance1
: ^877754- To compare the metrics side-by-side, I decided to simulate some load on
instance1
while leavinginstance2
idle. - I SSH-ed into
instance1
. - To increase CPU usage, I ran:
while true; do openssl dgst -sha256 /dev/zero; done &
- To generate some network traffic, I used the
curl
command to download a large file multiple times:while true; do curl -O https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles.xml.bz2; done &
- This step ensured that
instance1
was now actively using CPU and network resources, whileinstance2
remained idle.
- To compare the metrics side-by-side, I decided to simulate some load on
-
Results from CloudWatch Metrics: After initiating the CPU-intensive task on
instance1
NetworkPacketsIn:
Instance1
showcased heightened incoming packets due to the network tasks.CPUUtilization:
High CPU usage was evident onInstance1
from the hashing operation.