Monitoring CPU Utilization of Multiple Instances with a Single Alarm


Currently, I am seeking a way to efficiently monitor and receive alerts for high CPU utilization on all instances using a single CloudWatch alarm.

Also, I would like to explore the possibility of implementing an event rule pattern that triggers an SNS notification when the CPU utilization surpasses a predefined threshold.

Request your guidance and support in the following areas: 1)Confirmation on the feasibility of utilizing Amazon CloudWatch Events and EventBridge to monitor CPU utilization and trigger SNS notifications when the threshold is exceeded. 2)Assistance in designing an appropriate event rule pattern to capture high CPU utilization events and generate the corresponding SNS notifications. 3)Recommendations on best practices and considerations to ensure reliable event capture and accurate notifications. 4)Any additional resources, documentation, or examples that can aid in the implementation of this solution.

1 Answer

You can make use of CloudWatch search expression syntax to create a single CloudWatch alarm that tracks CPU Utilization across all EC2 instances. For example, you can create a search expression that displays the AWS/EC2 CPUUtilization metric for all instances in the Region. If you later launch a new instance, the CPUUtilization of the new instance is automatically added to the graph. See reference document.

SEARCH('{AWS/EC2,InstanceId} MetricName="CPUUtilization"', 'Average')
answered 10 months ago
  • I don't know if this used to work but it doesn't as of March 2024. An error message is displayed "You cannot create an alarm on a math expression containing the SEARCH function"

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions