By using AWS re:Post, you agree to the Terms of Use

create one cloudwatch alarm for multiple instances


Hello everyone,

Is there any method that can create one cloudwatch alarm for multiple on-prem servers?

3 Answers

Hi there,

I understand that you would like to create a single Cloudwatch alarm for multiple on-premise servers. This can be achieved by installing the AWS CloudWatch agent on your on-premise servers which will the allow you to create a composite alarm. To install the CloudWatch agent, please see reference [1].

Please note that if you have downloaded the AWS CloudWatch agent on one computer and created the agent configuration file you want, you can use that configuration file to install the agent on other on-premises servers. Please see reference [2] to create a CloudWatch agent.

With Amazon CloudWatch composite alarms, you can now combine multiple alarms to reduce alarm noise and focus on critical operational issues. You can easily combine multiple alarms together into alarm hierarchies that only trigger once when multiple alarms fire at the same time.

To create a composite CloudWatch Alarm, please see reference [3].





I hope this helps.

answered a month ago
  • Hello @Asenathi,

    I very much appreciate your reply. But the thing is I want to set up same alarm to multiple servers. For example, let's say "mem_used_percent > 26" I want to set up this alarm for "x" servers. x is server count.


Hello rePost-User-7340636,

Once the metrics are available in the CloudWatch service, graph them first. You should then create a metric math expression based on the graphed metrics and set up an alarm over the expression. Hope this helps.

answered a month ago

Hi, there are 2 ways to understand your request, and I think the 2 answers you've already received are tied to the same way.

1 way to understand it is "I want a single alarm to show a unified status for multiple servers simultaneously. That is, an alarm that will turn red if one of the servers goes red". This is what the 2 other answers already help you with: you can create a composite alarm or metric-math alarm to blend multiple signals into a single alarm.

Another way to understand your request is "I want to write only once a single alarm definition that can monitor every server I send metrics for, and every server is monitored separately (a distinct action will be executed for every server that crosses the threshold, and I can see the status of each server separately)". At this time, you would need to implement custom logic to do that. When customers use EC2, they can rely on events to detect the addition of a server. Since you refer to on-prem servers, you cannot leverage the exact same approach: you'd need to either fire the lambda on a schedule to detect new metrics, or invoke the lambda yourself from your on-prem servers start/stop scripts.

Last option would be to be able to write once a single alarm definition that shows a unified status for multiple servers simultaneously, merging both points above. This last one is much simpler than it seems: you could simply ingest a custom metric without your server name in the dimensions, so that all servers' observations data is aggregated by CloudWatch as a single metric, and alarm using advanced statistics (e.g. the max, average, percentile or trimmed mean of that metric).

answered a month ago

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