I want see an alert when my disk space less than 5Gb in virtual machine.

%3CLINGO-SUB%20id%3D%22lingo-sub-2210373%22%20slang%3D%22en-US%22%3EI%20want%20see%20an%20alert%20when%20my%20disk%20space%20less%20than%205Gb%20in%20virtual%20machine.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2210373%22%20slang%3D%22en-US%22%3E%3CP%3EI%20want%20see%20an%20alert%20when%20my%20disk%20space%20less%20than%205Gb%20in%20virtual%20machine.%20Please%20provide%20the%20steps%20that%20need%20to%20be%20configured.%20I%20want%20to%20get%20the%20email%20notification%20when%20my%20VM%20disk%20space%20less%20than%205GB.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2216867%22%20slang%3D%22en-US%22%3ERe%3A%20I%20want%20see%20an%20alert%20when%20my%20disk%20space%20less%20than%205Gb%20in%20virtual%20machine.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2216867%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F997340%22%20target%3D%22_blank%22%3E%40kasunth%3C%2FA%3E%26nbsp%3Blook%20for%20the%20example%20query%20in%20the%20Logs%20blade.%26nbsp%3B%20Type%20in%20%22free%20disk%22%20to%20find%20a%20suitable%20query%20(or%20look%20at%20others)%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-03-17%20111959.jpg%22%20style%3D%22width%3A%20833px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F264798iD3CD0AAE738850A5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-03-17%20111959.jpg%22%20alt%3D%22Screenshot%202021-03-17%20111959.jpg%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3EIt%20tells%20you%20the%20next%20step%2C%20which%20is%26nbsp%3B%20-%20'To%20create%20an%20alert%20for%20this%20query%2C%20click%20'%2B%20New%20alert%20rule''%20-%20see%20here%26nbsp%3B%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Falerts%2Falerts-activity-log%23overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%2C%20view%2C%20and%20manage%20activity%20log%20alerts%20in%20Azure%20Monitor%20-%20Azure%20Monitor%20%7C%20Microsoft%20Docs%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2237319%22%20slang%3D%22en-US%22%3ERe%3A%20I%20want%20see%20an%20alert%20when%20my%20disk%20space%20less%20than%205Gb%20in%20virtual%20machine.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2237319%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F997340%22%20target%3D%22_blank%22%3E%40kasunth%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBelow%20is%20an%20instruction%20on%20how%20to%20create%20an%20alert%20based%20on%20custom%20log%3A%3C%2FP%3E%3CP%3E1.%20Go%20to%20Alerts%20Panel%20and%20click%20on%20%22Manage%20Actions%22.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_0-1616750398530.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267379i21797ECFA39D706C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22obakun_0-1616750398530.png%22%20alt%3D%22obakun_0-1616750398530.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E2.%20Create%20Action%20Group%20for%20your%20destination%20email%20address(here%20is%20a%20link%20with%20instruction%20about%20how%20to%20create%20action%20group%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Falerts%2Faction-groups%23create-the-action-group%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EHow%20to%20create%20action%20group%3C%2FA%3E).%3C%2FP%3E%3CP%3E3.%20Back%20to%20Alerts%20Panel%20and%20click%20%22Mange%20alert%20rules%22.%3C%2FP%3E%3CP%3E4.%20Click%20%22New%20alert%20rule%22.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_1-1616750508875.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267380iE8C08085BDD1C036%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22obakun_1-1616750508875.png%22%20alt%3D%22obakun_1-1616750508875.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E5.%20As%20a%20Scope%2C%20select%20Log%20Analytics%20Workspace%20that%20contains%20logs%20related%20to%20Free%20Disk%20Space.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_2-1616750903157.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267383i8270FB099BAC2175%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22obakun_2-1616750903157.png%22%20alt%3D%22obakun_2-1616750903157.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_3-1616750921918.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267384iBBC0B363DB766A90%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22obakun_3-1616750921918.png%22%20alt%3D%22obakun_3-1616750921918.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E6.%20In%20Condition%20area%2C%20click%20%22Add%20condition%22%2C%20as%20signal%20type%20choose%20%22Log%22%20and%20then%20choose%20%22Custom%20log%20search%22.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_4-1616750971231.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267385i291D1363DBA272B9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22obakun_4-1616750971231.png%22%20alt%3D%22obakun_4-1616750971231.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E7.%20Copy%20query%20below%20and%20past%20into%20%22Search%20query%22%20area%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-sql%22%3E%3CCODE%3Elet%20PercentSpace%20%3D%2010%3B%0APerf%0A%7C%20where%20ObjectName%20%3D%3D%20%22LogicalDisk%22%20and%20CounterName%20%3D%3D%20%22%25%20Free%20Space%22%0Aor%20ObjectName%20%3D%3D%20%22Logical%20Disk%22%20and%20CounterName%20%3D%3D%20%22%25%20Free%20Space%22%0A%7C%20where%20InstanceName%20!%3D%20%22D%3A%22%0A%7C%20summarize%20FreeSpace%20%3D%20avg(CounterValue)%20by%20Computer%2C%20InstanceName%0A%7C%20where%20InstanceName%20contains%20%22%3A%22%20or%20InstanceName%20%3D%3D%20%22%2F%22%0A%7C%20where%20FreeSpace%20%26lt%3B%20PercentSpace%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E8.%20Set%20alert%20logic%20as%20on%20screenshot%20below%20and%20click%20%22Done%22%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_5-1616751369125.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267387iE8A1BFCA09B2236F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22obakun_5-1616751369125.png%22%20alt%3D%22obakun_5-1616751369125.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E9.In%20Action%20area%2C%20add%20Action%20Group%20that%20you%20have%20created%20in%20step%202.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_7-1616751679904.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267392iA9453985BD262865%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22obakun_7-1616751679904.png%22%20alt%3D%22obakun_7-1616751679904.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E10.%20Customize%20your%20alert%20like%20on%20example%20below%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22obakun_6-1616751572976.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267391iF804E5D58890F61B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22obakun_6-1616751572976.png%22%20alt%3D%22obakun_6-1616751572976.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E11.%20Click%20%22Save%22.%3C%2FP%3E%3CP%3E12.%20Enable%20your%20alert%20and%20that's%20all.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

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.

 

 

2 Replies

@kasunth look for the example query in the Logs blade.  Type in "free disk" to find a suitable query (or look at others)Screenshot 2021-03-17 111959.jpg
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


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".

obakun_0-1616750398530.png

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".

obakun_1-1616750508875.png

5. As a Scope, select Log Analytics Workspace that contains logs related to Free Disk Space.

obakun_2-1616750903157.png

obakun_3-1616750921918.png

6. In Condition area, click "Add condition", as signal type choose "Log" and then choose "Custom log search".

obakun_4-1616750971231.png

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":

obakun_5-1616751369125.png

9.In Action area, add Action Group that you have created in step 2.

obakun_7-1616751679904.png

 

10. Customize your alert like on example below:

obakun_6-1616751572976.png

11. Click "Save".

12. Enable your alert and that's all.