Forum Discussion
brijohn
Jun 22, 2022Copper Contributor
Need to fetch VM CPU, Memory & Disk usage that are less than 50%
Hi Team,
I have configured all the vms in Loganalytics.
Enabled diagnostic setting and insights for the vm.
I need a Kusto Query to fetch VM CPU, Memory & Disk usage that are less than ...
SebasL
Jul 06, 2022Copper Contributor
Hello brijohn ,
One of the factor is to define what is considered to be a threshold violation.
Example: A CPU that reaches 95% over a period of 20 seconds is not necessarily a issue if its average over 1 minute is at 7%.
//% CPU usage:
Perf
| where Computer == "YourVM-Name"
| where ObjectName == 'Processor' and CounterName == '% Processor Time' and InstanceName == '_Total'
| summarize AvgCPUPct=avg(CounterValue) by bin (TimeGenerated, 5m)
| render timechart title = "% CPU usage (bin to 5min)"
//Committed Bytes in use % (Virtual + Physical Memory):
Perf
| where Computer == "YourVM-Name"
| where ObjectName == "Memory" and CounterName == "Available MBytes"
| summarize AvgAvailableRAM = avg(CounterValue/1024) by bin (TimeGenerated, 5m)
| project AvgAvailableRAM, TimeGenerated
//Disk Queue Length:
Perf
| where Computer == "YourVM-Name"
| where ObjectName == "PhysicalDisk" and CounterName == "Avg. Disk Queue Length" and InstanceName contains "_Total"
| summarize AvgDQ=avg(CounterValue) by bin (TimeGenerated, 5m)
| project AvgDQ, TimeGenerated