Amazon CloudWatch monitors
your Amazon Web Services (AWS) resources and the applications you run on AWS in
real time.
You can use CloudWatch to collect and track metrics, which are
variables you can measure for your resources and applications.
The CloudWatch home page automatically displays
metrics about every AWS service you use. You can additionally create custom
dashboards to display metrics about your custom applications, and display
custom collections of metrics that you choose.
You can create alarms which watch metrics and
send notifications or automatically make changes to the resources you are
monitoring when a threshold is breached.
For example, you can
monitor the CPU usage and disk reads and writes of your Amazon EC2 instances
and then use this data to determine whether you should launch additional
instances to handle increased load.
You can also use this data to stop
under-used instances to save money.
With CloudWatch, you gain system-wide visibility
into resource utilization, application performance, and operational health.
Following are the terms associated with CloudWatch:
- Dashboards: CloudWatch is used to create dashboards to show what is happening with your AWS environment.
- Alarms: It allows you to set alarms to notify you whenever a particular threshold is hit.
- Logs: CloudWatch logs help you to aggregate, monitor, and store logs.
- Events: CloudWatch help you to respond to state changes to your AWS resources.
Creating a Dashboard
- Sign in to the AWS Management Console.
- I created an EC2 instance, and the name of an EC2 instance is EC2instance.
- Move to the CloudWatch service.
- Click on the Dashboards appearing on the left side of the console.
- Click on the Create dashboard button. Enter the dashboard name. Suppose I write the dashboard name as WebServer.
- Click on the Create dashboard.
- Select the widget type and add to the dashboard.
- I add the Line widget to our dashboard.
- After adding a line widget, you have to choose the service. I choose the EC2 service.
- Click on the per-instance metrics.
- Choose the CPUUtilization as a metric name and click on the create widget button.
- The below screen shows the CPU utilization in the form of line widget.
- I add another widget known as stacked area.
The above screen shows the CPU utilization in the form of a colored graph.
Creating an Alarm
- Click on the Alarms appearing on the left side of the console.
- Click on the Create Alarm.
- Select a metric.
- select an EC2.I
- Click on the Per-Instance Metrics.
- I select a CPUUtilization metric.
- Enter the Alarm details.
The above details show that when CPU utilization is greater than 80%, then an alarm is triggered and sent to the email address that you mentioned while filling the alarm details.
- Click on the link sent to your email address for confirmation and this confirmation shows that you are ready to receive the alerts.
No comments:
Post a Comment