|
| 1 | +--- |
| 2 | +title: Create availability alert rule for Azure virtual machine (preview) |
| 3 | +description: Create an alert rule in Azure Monitor to proactively notify you if a virtual machine is unavailable. |
| 4 | +ms.service: azure-monitor |
| 5 | +ms.topic: article |
| 6 | +ms.custom: subject-monitoring |
| 7 | +ms.date: 11/04/2021 |
| 8 | +ms.reviewer: Xema Pathak |
| 9 | +--- |
| 10 | + |
| 11 | +# Create availability alert rule for Azure virtual machine (preview) |
| 12 | +When you create a new Azure virtual machine, you can quickly enable a set of recommended alert rules that will provide you with initial monitoring for a common set of performance counters. |
| 13 | + |
| 14 | +In this article, you learn how to: |
| 15 | + |
| 16 | +> [!div class="checklist"] |
| 17 | +> * View the VM availability metric that shows when a VM is running. |
| 18 | +> * Create an alert rule using the VM availability metric to notify you if the virtual machine is unavailable. |
| 19 | +> * Create an action group to be proactively notified when an alert is created. |
| 20 | +
|
| 21 | +## Prerequisites |
| 22 | +To complete the steps in this article you need the following: |
| 23 | + |
| 24 | +- An Azure virtual machine to monitor. |
| 25 | + |
| 26 | +> [!IMPORTANT] |
| 27 | +> If the VM has any other alert rules associate with it, then recommended alerts will not be available. |
| 28 | +
|
| 29 | + |
| 30 | +## Create alert rules |
| 31 | +From the menu for the VM, select **Alerts**. You'll se a brief description of recommended alerts and the option to enable them. Click **Enable recommended alert rules**. |
| 32 | + |
| 33 | +:::image type="content" source="media/tutorial-monitor-vm/recommended-alerts-enable.png" alt-text="Screenshot of option to enable recommended alerts for a virtual machine." lightbox="media/tutorial-monitor-vm/recommended-alerts-enable.png"::: |
| 34 | + |
| 35 | + |
| 36 | +A list of recommended alert rules is displayed. You can select which ones to create and change their recommended threshold if you want. Ensure that **Email** is enabled and provide an email address to be notified when any of the alert rules fires. An [action group](../alerts/action-groups.md) will be created with this address. If you already have an action group that you want to use, you can specify it instead. |
| 37 | + |
| 38 | + |
| 39 | +:::image type="content" source="media/tutorial-monitor-vm/recommended-alerts-configure.png" alt-text="Screenshot of recommended alert rule configuration." lightbox="media/tutorial-monitor-vm/recommended-alerts-configure.png"::: |
| 40 | + |
| 41 | +## View created alert rules |
| 42 | + |
| 43 | +When the alert rule creation is complete, you'll see the alerts screen for the VM. |
| 44 | + |
| 45 | +:::image type="content" source="media/tutorial-monitor-vm/recommended-alerts-complete.png" alt-text="Screenshot of alert screen for a VM." lightbox="media/tutorial-monitor-vm/recommended-alerts-complete.png"::: |
| 46 | + |
| 47 | +Click **Alert rules** to view the alert rules that you just created. You can see that a rule has been created for each that you selected. If the threshold is exceeded for any of these rules, an Azure Monitor alert will be created, and an email will be sent to the address that you specified. |
| 48 | + |
| 49 | +:::image type="content" source="media/tutorial-monitor-vm/recommended-alerts-rules.png" alt-text="Screenshot of list of created alert rules." lightbox="media/tutorial-monitor-vm/recommended-alerts-rules.png"::: |
| 50 | + |
| 51 | + |
| 52 | +## View the alert |
| 53 | +To test the alert rule, stop the virtual machine. If you configured a notification in your action group, then you should receive that notification within a few minutes. You'll also see an alert indicated in the summary shown in the **Alerts** page for the virtual machine. |
| 54 | + |
| 55 | +:::image type="content" source="media/tutorial-monitor-vm/alerts-summary.png" lightbox="media/tutorial-monitor-vm/alerts-summary.png" alt-text="Alerts summary"::: |
| 56 | + |
| 57 | +Click on the **Severity** to see the list of those alerts. Click on the alert itself to view its details. |
| 58 | + |
| 59 | +:::image type="content" source="media/tutorial-monitor-vm/alerts-summary.png" lightbox="media/tutorial-monitor-vm/alerts-summary.png" alt-text="Alerts list"::: |
| 60 | + |
| 61 | +## Next steps |
| 62 | +Now that you know how to create an alert from log data, collect additional logs and performance data from the virtual machine with a data collection rule. |
| 63 | + |
| 64 | +> [!div class="nextstepaction"] |
| 65 | +> [Collect guest logs and metrics from Azure virtual machine](tutorial-monitor-vm-guest.md) |
| 66 | +
|
| 67 | + |
| 68 | + |
| 69 | +## Next steps |
| 70 | +Now that you know how to create an alert from log data, collect additional logs and performance data from the virtual machine with a data collection rule. |
| 71 | + |
| 72 | +> [!div class="nextstepaction"] |
| 73 | +> [Collect guest logs and metrics from Azure virtual machine](tutorial-monitor-vm-guest.md) |
| 74 | +
|
0 commit comments