Forum Discussion

DSM4201's avatar
DSM4201
Copper Contributor
Jun 14, 2023

Azure Monitor disk space used report

Hi,

 

I need some help creating a KQL query that shows the disk space used.  The query would need to output something similar to the VM insights report that shows the current disk size and the disk space used.

 

I have a query for free disk space but I'll need a query for used disk space so I can create an alert from the query. 

Thanks,

D

6 Replies

  • PradeepDeiva's avatar
    PradeepDeiva
    Copper Contributor

    Try this

     

    InsightsMetrics | where Origin == "vm.azm.ms" and Namespace == "LogicalDisk" and Name == "FreeSpacePercentage" | extend Disk=tostring(todynamic(Tags)["vm.azm.ms/mountId"]) | summarize Disk_Free_Space = avg(Val) by Computer, Disk, _ResourceId | project Computer, Disk, Disk_Free_Space

      • PradeepDeiva's avatar
        PradeepDeiva
        Copper Contributor

        DSM4201 

        yea , for Linux - % free space and for Windows - %used space are not direct
        check this link - https://www.catapultsystems.com/blogs/calculating-total-memory-and-total-disk-space-in-log-analytics/

        try adding a last column with the values got from free space and total size - we can calculate the %

        hope this helps

Resources