Azure Monitor: Free Disk Space % Alerts

This recipe shows how to quickly create Azure Alerts that will be triggered for both Linux and Windows virtual machines, by configuring Free Space % alerts using simple and customizable KQL queries.

Step 1 - DCR Rules

Make sure that your source vms are all reporting to your destination LAW as Resources in your AMA DCR. (Your DCR must be configured with Platform Type: Custom > to support Windows and Linux AMA to a destination Log Analytics Workspace).

Step 2 - KQL Query

Go to your destination Log Analytics Workspace > Logs > and create your custom KQL query > and verify the output. (Ive used a simple metric query for this example which runs against my Windows and Linux vms).

Perf
| where CounterName has "% Free Space"
| where CounterValue < ( 99.00)

When you are satisfied that your KQL query is correct, then click on New alert rule button on your KQL query.

Step 3 - Alert Rule


The Condition tab will automatically populate with the same KQL script you created earlier.

The Signal name will show Custom log search

Measurement > (leave settings as default)

Alert Logic > I have amended the values for my testing purpose. I want an alert triggered when 1 threshold limit is reached at every 5 minute interval.

Go back to the Scope tab to change the scope of you need to. (I want all the vms in the resource group to be monitored.)

The preview pane will show you the expected rate of triggers per your selected Time range > Next

Actions tab > select / create your destination action group.

Notifications for the action group:
1. I have configured an email recipient, as well as,

2. Configured the option to receive alerts on my mobile phone. Install the app and login to the tenant.

Details tab:

Select the Alert severity, a descriptive Alert Rule Name, optional description > Create

Verification:

After creating your azure alert > go to Monitor > Alerts > and verify that your alerts has been successfully created.

Depending on what your Alert Logic > Frequency of Evaluation (eg 5 minutes), the recipients should start seeing emails arriving for each vm that has any disks below 99% free space (or as per your bespoke settings).

Step 4 - Notifications

The recipient will receive individual emails generated per vm that has triggered the alerts.

As well as on the Azure mobile app:

Rate Limits

Be careful not to set your alert frequency to low. Take into consideration the number of alerts that will be generated, so as not to exceed your rate limit.

How to increase your default rate limit?


If you need to increase your rate limit, submit a ticket by following the New Support Request link on your resource’s page in the Azure portal. Remember to include a business justification in the request.

23 comments

  1. Excellent read, I just passed this onto a friend who was doing some research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that: Thank you for lunch!

  2. What抯 Happening i am new to this, I stumbled upon this I have found It positively helpful and it has aided me out loads. I hope to contribute & help other users like its helped me. Great job.

  3. Everyone loves what you guys are up too. This type of clever work and exposure! Keep up the great works guys I’ve included you guys to our blogroll.

Leave a comment

Your email address will not be published. Required fields are marked *