AWS Cloudwatch
AWS Cloudwatch
AWS Cloudwatch
3. After creating the Bash script, give execute permissions to the file.
$ crontab -e
*/1 * * * * /home/ec2-user/mem.sh
The graph shows the number of messages published, delivered, and filtered out
within the timeframe you specify (1h, 3h, 12h, 1d, 3d, 1w, or custom).
To set alarms using the CloudWatch console:
1. Sign in to the AWS Management Console and open the CloudWatch console at
https://console.aws.amazon.com/cloudwatch/.
2. Choose Alarms, and then choose the Create Alarm button. This launches
the Create Alarm wizard.
3. Scroll through the Amazon SNS metrics to locate the metric you want to place an
alarm on. Select the metric to create an alarm on and choose Continue.
4. Fill in the Name, Description, Threshold, and Time values for the metric, and
then choose Continue.
5. Choose Alarm as the alarm state. If you want CloudWatch to send you an email
when the alarm state is reached, either select a preexisting Amazon SNS topic or
choose Create New Email Topic. If you choose Create New Email Topic, you
can set the name and email addresses for a new topic. This list will be saved and
appear in the drop-down box for future alarms. Choose Continue.
Note:
If you use Create New Email Topic to create a new Amazon SNS topic, the
email addresses must be verified before they will receive notifications. Emails are
sent only when the alarm enters an alarm state. If this alarm state change
happens before the email addresses are verified, they will not receive a
notification.
6. At this point, the Create Alarm wizard gives you a chance to review the alarm
you’re about to create. If you need to make any changes, you can use
the Edit links on the right. Once you are satisfied, choose Create Alarm.
Example:
a. Under Alarm Threshold, enter a unique name for the alarm (for
example, myHighCpuAlarm) and a description of the alarm (for
example, CPU usage exceeds 70 percent). Alarm names must contain
only ASCII characters.
b. Under Whenever, for is, choose > and enter 70. For for, enter 2. This
specifies that the alarm is triggered if the CPU usage is above 70 percent
for two consecutive sampling periods.
c. Under Actions, for Whenever this alarm, choose State is ALARM.
For Send notification to, select an existing SNS topic or create a new
one.
d. To create a new SNS topic, choose New list. For Send notification to, enter a
name for the SNS topic (for example, myHighCpuAlarm), and for Email list,
enter a comma-separated list of email addresses to be notified when the alarm
changes to the ALARM state. Each email address is sent a topic subscription
confirmation email. You must confirm the subscription before notifications can be
sent.
e. Choose Create Alarm.