Alarms
In this article:
Alarms#
Alarm allows you to track changes in metric values for instances, volumes, Auto Scaling Groups, and buckets over a predefined period of time and initiate sending notifications when a specified condition occurs. For example, a user can be notified if the average CPU utilization for a given instance (or average CPU utilization for all instances in an Auto Scaling Group) has exceeded 80% during the last hour.
Alarm description#
An alarm has the following parameters:
Name — alarm name
Description – short description of alarm (optional)
Metric – the full metric ID, including namespace, metric name, and dimension.
Number of periods – the number of specified time periods, over which metric values are collected.
Period duration
Statistics – a function, which aggregates metric values over the specified period.
Threshold – value against which the aggregated metric values will be compared.
Comparison Operator – arithmetic operation used to compare a metric with a threshold value (>, ≥, ≤, <).
Action – action performed when the alarm status changes (Send e-mail or Execute policy).
email — an email address to which a notification is sent when the action Send email is chosen
Auto Scaling Group — an auto scaling group to which the action “Execute policy” is applied
Policy — a policy executed when the action Execute policy is selected
The following statistics can be calculated for a metric:
Average – average value
Sum – sum of values
Maximum – maximum value.
Minimum – minimum value.
Number of points – the number of entries with metric data.
Each statistics is calculated for one period.
Note
In case of Auto Scaling Group, the average value for the corresponding metrics of instances in the group is calculated.
An alarm can be in one of three states:
INSUFFICIENT DATA – the amount of data collected is insufficient to validate the respective metric.
OK – the metric value does not match the threshold condition.
ALARM – the metric value matches the threshold condition.
Creating an alarm#
To create a new alarm, click Create in the Alarms subsection. This will open the Alarm wizard, which consists of two mandatory steps and an optional one.
At the Metric step, specify the metric to be monitored:
the namespace from which the metric is selected.
Entity ID — ID of an instance, volume, or Auto Scaling Group, or the name of a bucket, depending on the selected namespace.
Metric name.
Note
If you select the AWS/EC2 namespace, you must also select the Entity or Auto Scaling Group resource type.
At the Parameters step, specify the remaining alarm parameters.
The alarm name and, optionally, its description
Statistics
The condition of triggering an alarm for the selected metric. It includes a comparison operator and a threshold value. If necessary, you can also change the metric selected in the previous step.
The number and duration of time periods, over which metric values are collected.
In addition, this step displays a metric graph with a threshold level. This allows you to adjust the threshold value based on the latest metric values.
Optionally, you can also setup actions executed when an alarm state changes. To do this, go to the Action step by clicking Set actions. The available actions include sending email notifications and executing a policy for an Auto Scaling Group.
Note
You can set up to five actions for each alarm.
To set the email address to which notifications will be sent when the alarm status changes, click on send an email notifications. Select the state of the alarm at which the notification should be sent, and specify the address to which it will be sent. The notification contains the time of state change, the reason for the change and other information.
To assign a policy to the alarm, click on execute an Auto Scaling Group policy. Select the state of the alarm at which the scaling policy should be executed, the group to which the policy belongs, and the policy itself. When the alarm goes to the predefined state, instances from the specified Auto Scaling Group will be added or removed, depending on the conditions of the policy. Learn more about Auto Scaling Group policies.
If necessary, you can change the selected action.
Note
A policy can be applied to a different group than the one whose metrics are controlled by the alarm. Moreover, you can assign a policy to the alarm even if the monitored resource does not belong to any Auto Scaling Group. For example, you can monitor the metrics of an instance with a load balancer and, depending on its values, apply different policies to the group the load balancer serves.
To add additional actions, click Add actions.
Alarm usage example#
If Number of periods is set to 1, Period duration is set to 3600 seconds, and statistics is set to Maximum, then the alarm will monitor the maximum value of the metric for the last hour.
If Number of periods is set to 12 and Period duration is set to 300 seconds, then the alarm will validate the maximum value of the metric every five minutes during the last hour. The alarm will be triggered only if the condition is met for all periods.
Note
By varying the number and duration of the periods, you can fine-tune the frequency of validating the metric values, depending on how critical, for example, processor load peaks are for your tasks. Note that the total duration of the periods must not exceed 24 hours.
For a more flexible alarm setup, use CloudWatch API.
Change an alarm#
To change the alarm parameters, go to the Alarm subsection, select the alarm and click Edit. The dialog that opens is similar to the second step of the alarm wizard.
Available alarms#
The list of all monitored alarms can be found in the Alarms subsection. For each alarm, the following parameters are shown:
State.
Alarm name.
Condition – an alarm triggering rule when it goes into the ALARM state.
Dimensions — the ID of the instance, volume, or Auto Scaling Group for which this alarm was created.
Clicking the alarm name opens alarm page.
Information on an alarm#
There are two tabs on the alarm page: Information and History of Changes.
The Information tab#
This tab shows:
alarm state and the reason why it is in this state;
alarm parameters;
an interactive graph of the metric, which is monitored by the alarm;
controls used to change or delete the alarm.
The History of Changes tab#
This tab shows a list of alarm-related events. There may be three types of events:
alarm modification (creation, deletion, and change)
change in alarm state;
Executed actions — sending an email notification or executing an Auto Scaling Group policy