Skip to content

Commit 4d5ac45

Browse files
committed
tutorials
1 parent a429b3b commit 4d5ac45

File tree

4 files changed

+124
-9
lines changed

4 files changed

+124
-9
lines changed

articles/azure-monitor/toc.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ items:
4040
href: alerts/tutorial-log-alert.md
4141
- name: Virtual machines
4242
items:
43-
- name: Enable monitoring
44-
href: vm/tutorial-monitor-vm-enable.md
45-
- name: Alert on machine down
46-
href: vm/tutorial-monitor-vm-alert.md
43+
- name: Create availability alert
44+
href: vm/tutorial-monitor-vm-alert-availability.md
4745
- name: Collect guest logs and metrics
4846
href: vm/tutorial-monitor-vm-guest.md
47+
- name: Create heartbeat alert
48+
href: vm/tutorial-monitor-vm-alert.md
49+
- name: Enable VM insights
50+
href: vm/tutorial-monitor-vm-enable.md
4951
- name: Application Insights
5052
items:
5153
- name: Application Insights SDK for ASP.NET Core applications
171 KB
Loading
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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 run for Azure virtual machine (preview)
12+
One of the most common alerting conditions for a virtual machine is whether the virtual machine is running. The best method is to create a metric alert rule in Azure Monitor using VM availability metric which is currently in public preview.
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+
20+
## Prerequisites
21+
To complete the steps in this article you need the following:
22+
23+
- An Azure virtual machine to monitor.
24+
25+
26+
27+
## View the VM availability metric
28+
Start by viewing the VM availability metric for your VM. Open the **Overview** page and then the **Monitoring** tab. This shows trending for several common metrics for the VM. Scroll down to view the chart for VM availability (preview). The value of the metric will be 1 when the VM is running and 0 when it's not.
29+
30+
31+
## Create alert rule
32+
There are multiple methods to create an alert rule in Azure Monitor. In this tutorial, we'll create it right from the metric value. Click on the VM availability chart to open the metric in [metrics explorer](). This is a tool in Azure Monitor that allows you to interactively analyze metrics collected from your Azure resources.
33+
34+
35+
Click **New alert rule**. This starts the creation of a new alert rule using the VM availability metric and the current VM. You do need to provide a couple of details though. The logic you want is to fire an alert when the value of the metric is less than 1. We'll have the alert rule check every minute.
36+
37+
Set the following values for the **Alert logic**. This specifies that the alert will fire whenever the average value of the availability metric falls below 1, which indicates that the VM isn't running.
38+
39+
| Setting | Value |
40+
|:---|:---|
41+
| Threshold | Static |
42+
| Aggregation Type | Average |
43+
| Operator | Less than |
44+
| Unit | Count |
45+
| Threshold value | 1 |
46+
47+
Set the following values for **When to evaluate**. This specifies that the rule will run every minute, using the collected values from the previous minute.
48+
49+
50+
| Setting | Value |
51+
|:---|:---|
52+
| Check every | 1 minute |
53+
| Loopback period | 1 minute |
54+
55+
56+
> [!TIP]
57+
> You can create an alert rule for a group of VMs in the same region by changing the scope of the alert rule to a subscription or resource group.
58+
59+
60+
## Configure action group
61+
The **Actions** page allows you to add one or more [action groups](../alerts/action-groups.md) to the alert rule. Action groups define a set of actions to take when an alert is fired such as sending an email or an SMS message.
62+
63+
If you already have an action group, click **Add action group** to add an existing group to the alert rule.
64+
65+
:::image type="content" source="media/tutorial-monitor-vm/alert-rule-actions.png" lightbox="media/tutorial-monitor-vm/alert-rule-actions.png" alt-text="Alert rule add action group.":::
66+
67+
If you don't already have an action group in your subscription to select, then click **Create action group** to create a new one. Select a **Subscription** and **Resource group** for the action group and give it an **Action group name** that will appear in the portal and a **Display name** that will appear in email and SMS notifications.
68+
69+
:::image type="content" source="media/tutorial-monitor-vm/action-group-basics.png" lightbox="./media/tutorial-monitor-vm/action-group-basics.png" alt-text="Action group basics":::
70+
71+
Select **Notifications** and add one or more methods to notify appropriate people when the alert is fired.
72+
73+
:::image type="content" source="media/tutorial-monitor-vm/action-group-notifications.png" lightbox="./media/tutorial-monitor-vm/action-group-notifications.png" alt-text="Action group notifications":::
74+
75+
## Configure details
76+
The **Details** page allows you to configure different settings for the alert rule.
77+
78+
- **Subscription** and **Resource group** where the alert rule will be stored. This doesn't need to be in the same resource group as the resource that you're monitoring.
79+
- **Severity** for the alert. The severity allows you to group alerts with a similar relative importance. A severity of **Error** is appropriate for an unresponsive virtual machine.
80+
- Keep the box checked to **Enable alert upon creation**.
81+
- Keep the box checked to **Automatically resolve alerts**. This will automatically resolve the alert when the virtual machine comes back online and heartbeat records are seen again.
82+
83+
:::image type="content" source="media/tutorial-monitor-vm/alert-rule-details.png" lightbox="media/tutorial-monitor-vm/alert-rule-details.png" alt-text="Alert rule details.":::
84+
85+
Click **Review + create** to create the alert rule.
86+
87+
## View the alert
88+
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.
89+
90+
:::image type="content" source="media/tutorial-monitor-vm/alerts-summary.png" lightbox="media/tutorial-monitor-vm/alerts-summary.png" alt-text="Alerts summary":::
91+
92+
Click on the **Severity** to see the list of those alerts. Click on the alert itself to view its details.
93+
94+
:::image type="content" source="media/tutorial-monitor-vm/alerts-summary.png" lightbox="media/tutorial-monitor-vm/alerts-summary.png" alt-text="Alerts list":::
95+
96+
## Next steps
97+
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.
98+
99+
> [!div class="nextstepaction"]
100+
> [Collect guest logs and metrics from Azure virtual machine](tutorial-monitor-vm-guest.md)
101+
102+
103+
104+
## Next steps
105+
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.
106+
107+
> [!div class="nextstepaction"]
108+
> [Collect guest logs and metrics from Azure virtual machine](tutorial-monitor-vm-guest.md)
109+

articles/azure-monitor/vm/tutorial-monitor-vm-enable.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
title: Enable monitoring for Azure virtual machine
2+
title: Enable monitoring with VM insights for Azure virtual machine
33
description: Enable monitoring with VM insights in Azure Monitor to monitor an Azure virtual machine.
44
ms.service: azure-monitor
55
ms.topic: article
66
ms.custom: subject-monitoring
7-
ms.date: 11/04/2021
7+
ms.date: 12/03/2022
88
ms.reviewer: Xema Pathak
99
---
1010

11-
# Enable monitoring for Azure virtual machine
12-
To monitor the health and performance of an Azure virtual machine, you need to install an agent to collect data from its guest operating system. VM insights monitors the guest operating system and workloads running on Azure virtual machines. When you enable monitoring for an Azure virtual machine, it installs the necessary agents and starts collecting performance, process, and dependency information from the guest operating system.
11+
# Enable monitoring with VM insights for Azure virtual machine
12+
To monitor the performance of the guest operating system and workloads in an Azure virtual machine, you need to install the Azure Monitor agent to collect data from its guest operating system. One option is to use VM insights, which installs the Azure Monitor agent and starts collecting a predefined set of performance counters. You can optionally enable the collection detailed process and telemetry to enable the Map feature of VM insights which gives you a visual representation of your VM environment.
13+
1314

1415
> [!NOTE]
1516
> If you're completely new to Azure Monitor, you should start with [Tutorial: Monitor Azure resources with Azure Monitor](../essentials/monitor-azure-resource.md). Azure virtual machines generate similar monitoring data as other Azure resources such as platform metrics and Activity log. This tutorial describes how to enable additional monitoring unique to virtual machines.
@@ -24,13 +25,16 @@ In this tutorial, you learn how to:
2425
2526

2627
> [!NOTE]
27-
> VM insights installs the Log Analytics agent which collects performance data from the guest operating system of virtual machines. It doesn't collect logs from the guest operating system and doesn't send performance data to Azure Monitor Metrics. For this functionality, see [Tutorial: Collect guest logs and metrics from Azure virtual machine](tutorial-monitor-vm-guest.md).
28+
> VM insights installs the Azure Monitor agent which collects performance data from the guest operating system of virtual machines. It doesn't collect logs from the guest operating system and doesn't send performance data to Azure Monitor Metrics. For this functionality, see [Tutorial: Collect guest logs and metrics from Azure virtual machine](tutorial-monitor-vm-guest.md).
2829
2930
## Prerequisites
3031
To complete this tutorial, you need the following:
3132

3233
- An Azure virtual machine to monitor.
3334

35+
> [NOTE!]
36+
> If you selected the option to **Enable virtual machine insights when you created your virtual machine, then VM insights will already be enabled.
37+
3438

3539

3640
## Create a Log Analytics workspace

0 commit comments

Comments
 (0)