Unable to setup alert for disk usage

Mahadev, Rakesh [HAEA] 140 Reputation points
2024-09-13T12:28:27.3466667+00:00

Hello All,

I'm trying to setup alert for VM disk usage when it exceeds more than 80% but I don't see the disk space usage percentage metric signal in Azure monitor alert rule. Kindly suggest.

I'm following below steps.

Select the Metric Signal:

  • For Disk Space Used Percentage:
    • Metric Namespace: Virtual Machine or Disks
      • Metric Name: Disk Space Used Percentage
  • For Disk Space Available:
  • Metric Namespace: Virtual Machine or Disks
    • Metric Name: Disk Space Available
Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,272 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 45,266 Reputation points Microsoft Employee
    2024-09-13T18:33:26.09+00:00

    @Mahadev, Rakesh [HAEA] Greetings!

    The "Disk Space Used Percentage" metric is not available in the Virtual Machine or Disks metric namespaces in Azure Monitor. Instead, you can achieve this by using a different approach. You can use Azure Monitor Logs and Kusto Query Language (KQL) to create a custom alert for disk space usage.

    First thing, you need to enable diagnostics for your VM to send data to a Log Analytics workspace.

    Create a Log Analytics workspace if you don't have one.

    Configure your VM to send performance counters to the Log Analytics workspace. You can do this by navigating to the VM's "Diagnostics settings" and selecting the appropriate performance counters (e.g., LogicalDisk(*)% Free Space).

    Use the following KQL query to calculate the disk space used percentage:

    User's image

    In the Azure portal, navigate to "Monitor" > "Alerts" > "+ New alert rule". Set the scope to your Log Analytics workspace, and for the condition, use the custom log search with the KQL query above. Set the threshold to trigger the alert when the disk space used percentage exceeds 80%.

    If you prefer using built-in metrics, you might need to use the "Free Space" metric and calculate the used space percentage manually.

    Useful resources:

    Hope this helps. If you have any further questions or need additional assistance, feel free to ask.


    If the response helped, do "Accept Answer" and up-vote it

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.