Friday 31 July 2020

How to configure email alert in AWS for EC2 instance, if CPU load is above 90%


If cpu utilisation is above 90%. then the below configuration will trigger an email notification conveying the same.


Practical steps:                                                                                                                                                       

1. Login to AWS console.                                                                                                                 
2.Ensure that your in correct require DC.                                                                                         
3.Navigate to Services --> under Management & Governance -->Cloudwatch as shown below.


4. Then the below display will display.                                                                                                 


5.Click on Alarms now.                                                                                                                                


6. Click on Create Alarm as shown below.                                                                                                              

7.Now click on select metric as shown below.                                                                                       


8.Click on EC2 as shown below.                                                                                                                   


9. Click on Per-instance Metrices.                                                                                                                   

10. In the new browser tab collect the EC2 instance id info from  running instance page(Services -->EC2-->Running instance -->collect the instance id number for correct EC2 instance for which CPU mail alert is required.

11. Based on the instance id number from the above step & CPU utilization from Metric Name column, select the correct entry, by select the check box as shown below.

12.Enter Alarm details:                                                                                                                                     Name & Description are free text, generally used for better identification among other alarms.   
is >= 90      is the actually value that will trigger the mail. 
1 minute out of 1minute, if the CPU utilization is above 90% for 1 minute out of 1 minute then mail will trigger.

eg: can use 5 minutes out of 3 minutes.
                  10 minutes out of 5 minutes.


13.Enter the recipient mail id by clicking on the New list option as shown below.                                                                       


14.Enter the Alarm description again here in the below highlighted field & click on create                       alarm option available at the right side bottom of the screen.                                                          


15.Then screen prompt for the mail confirmation screen. Open receipt mail id, inbox and conform the acknowledge the AWS alerts.


16.By click on the conformation link in the mail. screen similar like below will appears.                                   

17. Click on View Alert now.                                                                                                                        

18. Optional steps: To check the functionality of Alert. open the putty session for the EC2 instance and execute the lines while true; do echo; done;
so that CPU utilization reached to 90% with in short time.

To open the putty session for EC2 instance:                                                                                                  how to establish putty connection to AWS EC2 instance using AWS console      



19. Hurrah!!! It working.                                                                                                                                        


No comments:

Post a Comment