Forum Discussion
SurbhiGupta
Sep 06, 2021Copper Contributor
disk managment
hi, I am looking for way using KQL query or powerShell commands on how to automate capacity free space % free like we get from disk managment in windows server. Screenshot for example ...
SurbhiGupta
Sep 06, 2021Copper Contributor
DennesTorres Everything is set up in azure environment from monitoring agents to performance counters.
i just need KQL query which can give me data like one i have attached in a screenshot.
As if now my client is logging to individual machine and going to disk management to extract drive info like capacity , free space ,%free . All he wants that from azure portal can he extract that all using KQL minimizing his effort.
i know we can use perf parameter in log analytics workspace to get data but i am not able to frame correct KQL which can give all 3 parameters that my client is looking for
at present i am using below query.
Perf
| where TimeGenerated > startofday(datetime($From)) and TimeGenerated < endofday(datetime($To))
| where CounterName == '% Free Space' or CounterName == '% Used Space'
| where InstanceName!='/mnt' and InstanceName!='/mnt/resource'
| extend Free_Disk = iff(CounterName == '% Free Space',CounterValue, 100 - CounterValue )
| summarize AvgPercentFreeSpace = avg(Free_Disk) by CounterPath, Computer, bin(TimeGenerated, $Freq), CounterName, CounterValue, InstanceName, _ResourceId
| project ResourceID = split(_ResourceId, '/')[2], TimeGenerated=format_datetime(TimeGenerated, 'dd-MM-yyyy hh:mm:ss tt'), Computer, InstanceName, AvgPercentFreeSpace"
But it is not giving total capacity of individual drives just %free is giving
i want all three parameters like in attached screenshot from perf query. Is it possible or not
Regards,
Surbhi
i just need KQL query which can give me data like one i have attached in a screenshot.
As if now my client is logging to individual machine and going to disk management to extract drive info like capacity , free space ,%free . All he wants that from azure portal can he extract that all using KQL minimizing his effort.
i know we can use perf parameter in log analytics workspace to get data but i am not able to frame correct KQL which can give all 3 parameters that my client is looking for
at present i am using below query.
Perf
| where TimeGenerated > startofday(datetime($From)) and TimeGenerated < endofday(datetime($To))
| where CounterName == '% Free Space' or CounterName == '% Used Space'
| where InstanceName!='/mnt' and InstanceName!='/mnt/resource'
| extend Free_Disk = iff(CounterName == '% Free Space',CounterValue, 100 - CounterValue )
| summarize AvgPercentFreeSpace = avg(Free_Disk) by CounterPath, Computer, bin(TimeGenerated, $Freq), CounterName, CounterValue, InstanceName, _ResourceId
| project ResourceID = split(_ResourceId, '/')[2], TimeGenerated=format_datetime(TimeGenerated, 'dd-MM-yyyy hh:mm:ss tt'), Computer, InstanceName, AvgPercentFreeSpace"
But it is not giving total capacity of individual drives just %free is giving
i want all three parameters like in attached screenshot from perf query. Is it possible or not
Regards,
Surbhi
DennesTorres
Sep 07, 2021MVP
Hi,
1) Check the agent configuration. You can't query if the information is not there and you don't know how the agent is configured.
2) Use log analytics workspace to check the existing tables and test your query.
Kind Regards,
Dennes
1) Check the agent configuration. You can't query if the information is not there and you don't know how the agent is configured.
2) Use log analytics workspace to check the existing tables and test your query.
Kind Regards,
Dennes