severity = "Warning"
alarm_title = "Windows_memory_usage"
response = cw.put_metric_alarm(
AlarmName = "%s_%s_%s_(Lambda)" % (severity, nameinstance, alarm_title),
AlarmDescription='Windows Memory Usage',
ActionsEnabled=True,
AlarmActions=[ec2_sns,],
MetricName='Memory % Committed Bytes In Use',
Namespace='CWAgent',
Statistic='Average',
Dimensions=[ {'Name': "InstanceId", 'Value': instanceid},
{'Name': 'ImageId', 'Value': instance.image_id},
{'Name': 'objectname', 'Value': 'Memory'},
{'Name': 'InstanceType', 'Value': instance.instance_type}
],
Period=60,
EvaluationPeriods=3,
Threshold=80.0,
ComparisonOperator='GreaterThanOrEqualToThreshold'
)
if logging_verbosity > 9:
print (response)
Add a Comment