AWS - Cloud Watch

CloudWatch:- Monitoring service on the basis of metrics States of Alarm In Alarm : - If the metric value is greater than a threshold value. ...

CloudWatch:- Monitoring service on the basis of metrics

States of Alarm

In Alarm: - If the metric value is greater than a threshold value. Eg if you have set the threshold value of CPU utilization is > 50 and if EC2 instance CPU usage is > 50 then it is In Alarm State.

OK: If the metric value is less than a threshold value

Insufficient data: If the data which is collected by CloudWatch is not sufficient to determine the alarm then it is in an insufficient state.

EC2 Actions: These actions are performed on selected EC2 instances if an Alarm is triggered.

  • Stop 
  • Terminate 
  • Reboot

Step 1: Select CloudWatch Service.

Step 2: Click on Create Alarm Button

Step 3: Click on Metrics

Step 4: Select EC2 instance because we are monitoring EC2 instance.

Step 5: Click on Per instance Metrics

Step 6: Copy Instance Id in the search box

Step 7: Select Instance Id and Metric as CPU Utilization.

Step 8 Click on Select Metric Button.

Step 9: Keep all the properties same except below

            Threshold Type: Static

             Select : Greater Than (you can chose any option like >=,< etc)

            than : 50 ( I am selecting 50 so that I need to set the alarm if Cpu utilization is more than 50% of selected EC2 instance)

Click on Next Button.

Step 10 : Select In Alarm

Step 11 : Select SNS topic for notificaiton.

Step 12: Select EC2 Action and select Terminate Instance.

Step 13: Click on Next Button

Step 14: Give the Alarm Name and Click on Create Alarm Button.            

CloudWatch Log Monitoring

Step 1: Configure your IAM role or user for CloudWatch Logs

             Create a Role (Cloudwatchrole) for EC2 instance

             Attach Cloudwatch Full Access permission

             Add Role to Existing EC2 instance

Step 2: Install and configure CloudWatch Logs on an existing Amazon EC2 instance

            Connect to EC2 instance

            sudo yum update -y

           sudo yum install -y awslogs

           If required change /etc/awslogs/awslogs.conf to monitor the file. I am not changing anything in this file because I am monitoring /var/logs/messages file.

           By default, the /etc/awslogs/awscli.conf points to the us-east-1 Region. To push your logs to a different Region, edit the awscli.conf file and specify that Region.

            sudo systemctl start awslogsd

            sudo systemctl enable awslogsd.service 



Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
DevOpsWorld: AWS - Cloud Watch
AWS - Cloud Watch
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content