| Did this page help you? Yes No Tell us about it... |
This scenario walks you through how to use the AWS Management Console or the command line tools to set up an Amazon SNS notification and configure an alarm that monitors load balancer latency exceeding 100 ms.
The Create Alarm Wizard steps you through the process of creating an alarm.
To open the Create Alarm Wizard
Open the Amazon CloudWatch console at https://console.aws.amazon.com/cloudwatch/.
In the Navigation pane, click Alarms.
The Your CloudWatch Alarms page opens.

Click Create Alarm.
The SELECT METRIC page of the Create Alarm Wizard opens.

To select a metric for your alarm
Select ELB: Load Balancer Metrics from the Viewing drop-down list.
The metrics available for individual instances appear in the Metrics pane.
Select a row that contains Latency for a specific load balancer.
A graph showing average Latency for a single load balancer
appears next to the Statistic and Period drop-down lists.

Select Average from the Statistic drop-down list.
Select 1 Minute from the Period drop-down list.
Click Continue.
The DEFINE ALARM page of the Create Alarm Wizard opens.
To define the alarm name, description, and threshold
In the Name field, enter the name of the alarm, for example: myHighCpuAlarm.
In the Description field, enter a description of the alarm,
for example: Alarm when Latency exceeds 100ms.
Select > in the Define Alarm Threshold drop-down list.
Enter 0.1 in the first Define Alarm Threshold field
and 3 in the second field.
A graphical representation of the threshold appears on the page.

Click Continue.
The CONFIGURE ACTIONS page of the Create Alarm Wizard opens.

To configure an email action for an alarm
Select ALARM from the Alarm State drop-down list.
Select Create Email Topic... from the Topic drop-down list.
Two new fields named Topic and Emails replace the Topic drop-down list.

In the Topic field, enter a descriptive name for the Amazon SNS topic, for example: myHighCpuAlarm.
In the Emails field, enter a comma-separated list of email addresses to be notified when the alarm changes to the ALARM state.
Click ADD ACTION.
The action is saved and the ADD ACTION button becomes a REMOVE button.
Click Continue.
The REVIEW window of the Create Alarm Wizard opens.

Now that you have defined the alarm and configured the alarm's actions, you are ready to review the settings and create the alarm by following the steps in the next procedure.
To review the alarm settings and create the alarm
Review the alarm settings presented in the REVIEW page of the Create Alarm Wizard.
You can make changes to the settings using the Edit Definition, Edit Metric, or Edit Actions links.
Click Create Alarm to complete the alarm creation process.
A confirmation dialog box opens.

Click Close.
Your alarm is created.
To send an Amazon SNS email message when LoadBalancer Latency Exceeds 100 milliseconds
Create an Amazon SNS topic. See instructions for creating an Amazon SNS topic in Set Up Amazon SNS
Create the alarm.
Prompt>mon-put-metric-alarm --alarm-name lb-mon --alarm-description "Alarm when Latency exceeds 100ms" --metric-name Latency --namespace AWS/ELB --statistic Average --period 60 --threshold 100 --comparison-operator GreaterThanThreshold --dimensions LoadBalancerName=my-server --evaluation-periods 3 --alarm-actions arn:aws:sns:us-east-1:1234567890:my-topic --unit MillisecondsAmazon CloudWatch returns the following:
OK-Created Alarm
Test the alarm.
Force an alarm state change to ALARM:
Prompt>mon-set-alarm-state --state OKPrompt>mon-set-alarm-state --state ALARM
Amazon CloudWatch returns the following:
OK-Set alarm state value
Check that an email has been received.