简体   繁体   English

如何使用 Az 模块通过 PowerShell 获取 Azure 资源的 CPU 使用率

[英]How to get cpu usage of Azure resources through PowerShell with Az module

this is a revamped version of this post: how to get cpu usage of azure vm throught powershell这是这篇文章的修改版本: 如何通过 powershell 获取 azure vm 的 CPU 使用情况

With the Az module replacing the old AzureRM, what would be the equivalent of Get-AzureRmMetricDefinition?使用 Az 模块替换旧的 AzureRM,Get-AzureRmMetricDefinition 的等价物是什么? More importantly, how do you guys check the equivalent new cmdlets between the two modules, is there any documentation around on this?更重要的是,你们如何检查两个模块之间等效的新 cmdlet,是否有关于此的任何文档?

I can see two modules which could be related, Az.ApplicationInsights and Az.OperationalInsights but I can't find any cmdlet which has Metric as part of its name.我可以看到两个可能相关的模块,Az.ApplicationInsights 和 Az.OperationalInsights,但我找不到任何名称中包含Metric的 cmdlet。

I'm looking to retrieve CPU and RAM usage out of our AKS cluster nodes.我正在寻找从我们的 AKS 群集节点中检索 CPU 和 RAM 使用情况。

Thanks谢谢

Found it.找到了。 It's in the Az.Monitor module: Get-AzMetricDefinition.它位于 Az.Monitor 模块中:Get-AzMetricDefinition。

As a rule of thumb, everything which was Action-AzureRM* became Action-Az*.根据经验,Action-AzureRM* 的一切都变成了 Action-Az*。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM