Mar 15 2021
12:21 AM
- last edited on
Apr 08 2022
10:45 AM
by
TechCommunityAP
Mar 15 2021
12:21 AM
- last edited on
Apr 08 2022
10:45 AM
by
TechCommunityAP
I want see an alert when my disk space less than 5Gb in virtual machine. Please provide the steps that need to be configured. I want to get the email notification when my VM disk space less than 5GB.
Mar 17 2021 04:22 AM
@kasunth look for the example query in the Logs blade. Type in "free disk" to find a suitable query (or look at others)
It tells you the next step, which is - 'To create an alert for this query, click '+ New alert rule'' - see here
Create, view, and manage activity log alerts in Azure Monitor - Azure Monitor | Microsoft Docs
Mar 26 2021 02:45 AM
Hello @kasunth,
Below is an instruction on how to create an alert based on custom log:
1. Go to Alerts Panel and click on "Manage Actions".
2. Create Action Group for your destination email address(here is a link with instruction about how to create action group: How to create action group).
3. Back to Alerts Panel and click "Mange alert rules".
4. Click "New alert rule".
5. As a Scope, select Log Analytics Workspace that contains logs related to Free Disk Space.
6. In Condition area, click "Add condition", as signal type choose "Log" and then choose "Custom log search".
7. Copy query below and past into "Search query" area:
let PercentSpace = 10;
Perf
| where ObjectName == "LogicalDisk" and CounterName == "% Free Space"
or ObjectName == "Logical Disk" and CounterName == "% Free Space"
| where InstanceName != "D:"
| summarize FreeSpace = avg(CounterValue) by Computer, InstanceName
| where InstanceName contains ":" or InstanceName == "/"
| where FreeSpace < PercentSpace
8. Set alert logic as on screenshot below and click "Done":
9.In Action area, add Action Group that you have created in step 2.
10. Customize your alert like on example below:
11. Click "Save".
12. Enable your alert and that's all.