Forum Discussion
Query How to find disk free space in % in LINUX VM's
- Aug 20, 2018
Hi,
Indeed,"% Free Space" is a performance log sent from Windows. Linux is reporting "% Used space" instead, and unfortunately the object name is slightly different (with space), try this:
Perf | where ObjectName == "Logical Disk" and CounterName == "% Used Space" | summarize arg_max(TimeGenerated, *) by Computer
The 'arg_max' line is optional. I used it to return only the latest report per computer. Note this is the percent of used space, if you need free space you add this line:
| extend free_space=100-CounterValue
and the calculated value would appear as the right-most column on the results table.
HTH,
Noa
Hi,
Indeed,"% Free Space" is a performance log sent from Windows. Linux is reporting "% Used space" instead, and unfortunately the object name is slightly different (with space), try this:
Perf | where ObjectName == "Logical Disk" and CounterName == "% Used Space" | summarize arg_max(TimeGenerated, *) by Computer
The 'arg_max' line is optional. I used it to return only the latest report per computer. Note this is the percent of used space, if you need free space you add this line:
| extend free_space=100-CounterValue
and the calculated value would appear as the right-most column on the results table.
HTH,
Noa
Hi Noa,
I have tried below query but i am getting data C drive
But when i am trying to get data for all drives i am only getting for F:, Z:, H:, E: drive. Its strange that i am not getting for data for C: drive and other some drives. do not know why?
- Patrick NaughtonSep 04, 2018Brass Contributor
Perf
| where ObjectName == "LogicalDisk" and CounterName == "% Free Space"
| summarize arg_max(TimeGenerated, CounterValue) by Computer, InstanceNamearg_max was returning only a instance (the one with the most recent value) per computer in the form you used it in your question.
the query above will give you the most recent %Free for every logical disk.