Configuring status check alarms for your Lightsail instance
You can create an alarm that notifies you when a status check fails on your instance, so that you can fix the problem before it affects your applications for long. For more information about status checks, see Viewing status checks for your Lightsail instance.
For details about each alarm setting, such as the threshold, frequency, and duration, see Create Lightsail instance metric alarms.
Topics
Choosing a status check metric
You can create an alarm on any of the following metrics:
-
Status check failures – Notifies you when either status check fails. Choose this metric if you want one alarm that covers both checks.
-
System status check failures – Notifies you when the system status check fails, which means there is a problem with the AWS infrastructure that your instance runs on.
-
Instance status check failures – Notifies you when the instance status check fails, which means there is a problem inside your instance.
You can create up to two alarms for each metric. If you want to know which check failed as soon as you get the notification, create one alarm on System status check failures and one on Instance status check failures.
How alarms evaluate status check metrics
Each status check metric reports 0 when the check passes and 1 when it fails, once every minute. Alarms evaluate these metrics as a total over each 5-minute period. A value of 0 for a period means the check passed for the whole period. A value of 1–5 is the number of minutes in that period when the check failed.
Because the value is only above 0 when a check fails, you don't need to review historical data to choose a threshold, as you do for other instance metrics. A threshold of 0 with the Greater than rule catches any failure.
Suggested alarm settings
To be notified as soon as a status check fails, use the following settings. These are the default settings in the Lightsail console for status check metrics.
-
Rule – Greater than
-
Threshold – 0
-
Frequency – 1 time
-
Duration – 5 minutes
With these settings, the alarm triggers when a check fails at any point in a 5-minute period.
The instance status check can report a failure while your instance reboots. If you get notifications for these short failures and don't want them, set Frequency to 2 times and Duration to 10 minutes. The alarm then triggers only when a check fails in two 5-minute periods in a row.
Creating a status check alarm
Complete the following steps to create a status check alarm.
To open the alarm form for a status check metric
-
Sign in to the Lightsail console
. -
In the left navigation pane, choose Instances.
-
Choose the name of the instance for which you want to create an alarm.
-
Choose the Metrics tab on the instance management page.
-
Under Metric graphs, choose Status check failures, System status check failures, or Instance status check failures in the Select metric dropdown.
-
In the Alarms for section for the metric, choose Create alarm.
To configure and create the alarm
-
For Rule, choose Greater than.
-
For Threshold, enter
0. -
For Frequency (times), enter
1, or2if you don't want notifications for short failures during a reboot. -
For Duration, choose 5 minutes, or 10 minutes if you entered 2 for Frequency (times).
-
(Optional) Under Also notify me by, select Email to also get an email when the alarm is triggered. If you have not added an email contact in the AWS Region of your instance, the console prompts you to add one. For more information, see Metric notifications.
If you select Email, you can also select Send me a notification when the alarm is no longer triggered under Additional notifications, to know when the check passes again.
-
Choose Save to create the alarm.
When a status check alarm triggers, see Troubleshooting failed status checks on your Lightsail instance.