|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
You can create an CloudWatch alarm that sends an Amazon Simple Notification Service message when the alarm changes state. An alarm watches a single metric over a time period you specify, and performs one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The action is a notification sent to an Amazon Simple Notification Service topic or Auto Scaling policy. Alarms invoke actions for sustained state changes only. CloudWatch alarms will not invoke actions simply because they are in a particular state, the state must have changed and been maintained for a specified number of periods.
After an alarm invokes an action due to a change in state, its subsequent behavior depends on the type of action that you have associated with the alarm. For Auto Scaling policy notifications, the alarm continues to invoke the action for every period that the alarm remains in the new state. For Amazon Simple Notification Service notifications, no additional actions are invoked.
An alarm has three possible states:
OK—The metric is within the defined
ALARM—The metric is outside of the defined
INSUFFICIENT_DATA—The alarm has just started,
the metric is not available, or not enough data is available for the metric to determine
the alarm state
In the following figure, the alarm threshold is set to 3 and the minimum breach is 3
periods. That is, the alarm invokes its action only when the threshold is breached for 3
consecutive periods. In the figure, this happens with the third through fifth time periods,
and the alarm's state is set to
ALARM. At period six, the value dips below the
threshold, and the state reverts to
OK. Later, during the ninth time period, the
threshold is breached again, but not for the necessary three consecutive periods.
Consequently, the alarm's state remains
CloudWatch doesn't test or validate the actions you specify, nor does it detect any Auto Scaling or SNS errors resulting from an attempt to invoke nonexistent actions. Make sure your actions exist.
Common Features of Alarms
You can create up to 5000 alarms per AWS account. To create or update an alarm, you
PutMetricAlarm API function
You can list any or all of the currently configured alarms, and list any alarms in a
particular state using the
mon-describe-alarms command). You can further filter the list by
You can disable and enable alarms by using the
You can test an alarm by setting it to any state using the
SetAlarmState API (
command). This temporary state change lasts only until the next alarm comparison
Finally, you can view an alarm's history using the
mon-describe-alarm-history command). CloudWatch preserves alarm history
for two weeks. Each state transition is marked with a unique time stamp. In rare cases,
your history might show more than one notification for a state change. The time stamp
enables you to confirm unique state changes.
Some AWS resources do not send metric data to CloudWatch under certain conditions.
For example, Amazon EBS may not send metric data for an available volume that is not attached to an Amazon EC2 instance, because there is no metric activity to be monitored for that volume. If you have an alarm set for such a metric, you may notice its state change to Insufficient Data. This may simply be an indication that your resource is inactive, and may not necessarily mean that there is a problem.