温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Azure Monitor监控windows系统CPU使用率

发布时间:2020-05-28 15:39:18 来源:亿速云 阅读:494 作者:鸽子 栏目:云计算

如果我们之前没有启用性能计数器数据,则可以在Log Analytics Workspace中单击“ 高级设置”,再单击“ 数据”,现在单击“ Windows性能计数器”,最后单击“ 添加选定的性能计数器”:

Azure Monitor监控windows系统CPU使用率

查询收集到的数据
我们可以使用如下查询语句从我们收集到的数据中查询出系统的CPU使用率:

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
| render timechart

Azure Monitor监控windows系统CPU使用率

也可以使用如下语句来查看CPU使用率大于某个值的机器:

let setpctValue = 3;
Perf
| 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() step 10m by Computer
| render timechart

Azure Monitor监控windows系统CPU使用率

将性能图表固定到仪表板
若想将我们所查询出来的图表固定到Azure Dashboard,可以点击查询窗口右上方的“固定”按钮,然后选择我们要将图标展示在那个Dashboard。
Azure Monitor监控windows系统CPU使用率

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI