简体   繁体   English

收集 Azure Netapp 卷指标

[英]Collect Azure Netapp Volume metrics

Right now I'm viewing the Azure NetApp volume metrics using Azure Portal metrics dashboard.I can see only one month old data.现在,我正在使用 Azure 门户指标仪表板查看 Azure NetApp 卷指标。我只能看到一个月前的数据。 I'm planning to collect this data and save into SQL table.我打算收集这些数据并保存到 SQL 表中。 So that I have the history of this data (ie more than 30 days).这样我就有了这个数据的历史(即超过30天)。 Is there a powershell commands that I can use?我可以使用 powershell 命令吗?

enter image description here在此处输入图像描述

As per Azure NetApp Files: PowerShell One-Liners , you can use Get-AzMetric , provide StartTime and EndTime to get the history of data.根据Azure NetApp Files: PowerShell One-Liners ,您可以使用Get-AzMetric ,提供StartTimeEndTime来获取数据的历史记录。

Try the following code snippet taken from the document, for example:尝试从文档中提取的以下代码片段,例如:

Get-AzResource | Where-Object {$_.ResourceType -like 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes'} 
| Get-AzNetAppFilesVolume | Select-Object @{Name='ShortName'; Expression={$_.Name.split('/')[2]}}, @{Name='SizeGiB'; 
Expression={$_.UsageThreshold / 1024 / 1024 / 1024}},
 @{Name='ConsumedGiB'; 
Expression={[math]::Round($((Get-AzMetric -ResourceId $_.Id -MetricName 'VolumeLogicalSize'
 -StartTime $(get-date).AddMinutes(-15) -EndTime $(get-date) -TimeGrain 00:5:00 -WarningAction SilentlyContinue 
| Select-Object -ExpandProperty data | Select-Object -ExpandProperty Average) | Measure-Object -average).average / 1024 / 1024 / 1024, 2)}} | Format-Table 

You can refer to PowerShell and CLI for Azure NetApp Files and Azure NetApp Files metrics对于 Azure NetApp 文件和Azure NetApp 文件指标,您可以参考PowerShell 和 CLI

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

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