create one cloudwatch alarm for multiple instances

0

Hello everyone,

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

已提问 2 年前6874 查看次数
3 回答
1

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).

profile pictureAWS
Jsc
已回答 2 年前
0

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].

References:

[1] https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-on-EC2-Instance.html

[2] https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-cloudwatch-agent-configuration-file-wizard.html

[3] https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Composite_Alarm.html

I hope this helps.

已回答 2 年前
  • 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.

0

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.

AWS
专家
Shree_C
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则