aws-samples / amazon-cloudwatch-auto-alarms

Automatically create and configure Amazon CloudWatch alarms for EC2 instances, RDS, and AWS Lambda using tags for standard and custom CloudWatch Metrics.
MIT No Attribution
91 stars 85 forks source link

Not Sure if an Issue or My Misunderstanding - EC2 Tags #4

Closed RichieRogers closed 3 years ago

RichieRogers commented 3 years ago

Hi, I'm using this with some EC2 Windows instances and it works well for monitoring Drive C. However, some instances have other drives (eg D). I've tested adding: { 'Key': 'AutoAlarm-{}-LogicalDisk % Free Space-objectname-LogicalDisk-instance-D:-LessThanThreshold-5m-Average'.format( cw_namespace), 'Value': alarm_disk_space_percent_free_threshold },

into cw_auto_alarms.py, which also works, but that would then apply to ALL instances. I had hoped I could add an EC2 Tag: AutoAlarm-CWAgent-LogicalDisk % Free Space-objectname-LogicalDisk-instance-D:-LessThanThreshold-5m-Average With a value of 1. This doesn't appear to work, so I'm guessing I've misunderstood the README:

The tag name syntax for AWS provided metrics is:

AutoAlarm-----

Where:

Namespace is the CloudWatch Alarms namespace for the metric. For AWS provided EC2 metrics, this is AWS/EC2. For CloudWatch agent provided metrics, this is CWAgent by default. You can also specify a different name as described in the Configuration section. MetricName is the name of the metric. For example, CPUUtilization for EC2 total CPU utilization. ComparisonOperator is the comparison that should be used aligning to the ComparisonOperator parameter in the PutMetricData Amazon CloudWatch API action. Period is the length of time used to evaluate the metric. You can specify an integer value followed by s for seconds, m for minutes, h for hours, d for days, and w for weeks. Your evaluation period should observe CloudWatch evaluation period limits. Statistic is the statistic for the MetricName specified, other than percentile.

Can anyone help?

Thanks, Richie

RichieRogers commented 3 years ago

I managed to fix it by using: AutoAlarm-CWAgent-LogicalDisk % Free Space-objectname-LogicalDisk-instance-D:-LessThanThreshold-5m-Average for the Key and 20 for the value

Thanks, Richie