gpt4 book ai didi

aws-cloudformation - 使用 Cloud Formation 根据维度查询 Cloudwatch 指标

转载 作者:行者123 更新时间:2023-12-03 07:39:31 25 4
gpt4 key购买 nike

我已在 EC2 Linux 计算机上安装了 CW 代理并收到了每个分区的 disk_used_percemt 指标。我只想在一个分区上创建 CW 警报。我得到每个指标的以下维度,实例名称、InstanceId、ImageId、设备、fstype、路径、指标名称

enter image description here

现在我想使用 CW 创建警报,

命名空间:CWAgent

指标名称:disk_used_percent

InstanceId:X

设备:xvda1

我正在使用以下 CF 代码,

  CloudWatchAlarm:
Type: "AWS::CloudWatch::Alarm"
Properties:
AlarmName: "disk-space-threshold"
AlarmDescription: "A Cloudwatch Alarm that triggers when disk space of EBS is less than 50%"
MetricName: "disk_used_percent"
Namespace: "CWAgent"
Statistic: "Average"
Period: "60"
EvaluationPeriods: "1"
Threshold: "75"
ComparisonOperator: "GreaterThanOrEqualToThreshold"
TreatMissingData: "missing"
Dimensions:
- Name: InstanceId
Value: !Ref InstanceID
- Name: ImageId
Value: !Ref ImageID
- Name: device
Value: !Ref Device

创建警报时,显示数据不足。可能的问题是什么?

最佳答案

您无法按 3 个维度进行过滤。您始终必须使用完整的维度集来识别指标。

关于aws-cloudformation - 使用 Cloud Formation 根据维度查询 Cloudwatch 指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73145312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com