Get the App
SLTechnology News&Howtos  ›  Servers  › 

Azure Monitor monitors CPU utilization of windows system

Shulou Source: shulou.com Published: 2022-06-03 05:29:23 10月03日 Update

If we have not previously enabled performance counter data, we can click Advanced Settings in Log Analytics Workspace, click data, now click Windows performance counters, and finally click add selected performance counters:

Query the collected data

We can use the following query statement to query the CPU utilization of the system from the data we have collected:

Perf | where ObjectName = "Processor" and CounterName = "% Processor Time" and InstanceName = = "_ Total" and Computer in ((Heartbeat | distinct Computer)) | summarize PCT95CPUPercentTime = percentile (CounterValue, 95) by Computer | summarize max (PCT95CPUPercentTime) by Computer | join (Perf | where ObjectName = = "Processor" and CounterName = "% Processor Time" and InstanceName = "_ Total" and Computer in ((Heartbeat | distinct Computer)) on Computer | make-series PCT95CPUPercentTime = percentile (CounterValue, 95) on TimeGenerated from ago (5h) to now () step 10m by Computer | by Computer

You can also use the following statement to view machines whose CPU usage is greater than a certain value:

Let setpctValue = 3Perf | where ObjectName = = "Processor" and CounterName = = "% Processor Time" and InstanceName = = "_ Total" and Computer in ((Heartbeat | distinct Computer)) | summarize PCT95CPUPercentTime = percentile (CounterValue, 95) by Computer | where PCT95CPUPercentTime > setpctValue | summarize max (PCT95CPUPercentTime) by Computer | join (Perf | where ObjectName = = "Processor" and CounterName = "% Processor Time" and InstanceName = = "Total" and Computer in ((Heartbeat | distinct Computer)) on Computer | make-series PCT95CPUPercentTime = percentile (CounterValue, 95) on TimeGenerated from ago (5h) to now () to now 10m step |

Fix the performance chart to the dashboard

To pin the chart we have queried to Azure Dashboard, click the "fixed" button at the top right of the query window, and then select the Dashboard in which we want to display the icon.

Tags: Queries performance data counters usage charts statements systems advanced meters icons buttons machines dashboards selection monitoring Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Tech Info Apple Redmi Shulou Information