【问题标题】:Collect Azure Netapp Volume metrics收集 Azure Netapp 卷指标
【发布时间】:2022-07-01 12:14:29
【问题描述】:

现在我正在使用 Azure 门户指标仪表板查看 Azure NetApp 卷指标。我只能看到一个月前的数据。我打算收集这些数据并保存到 SQL 表中。这样我就有了这些数据的历史记录(即超过 30 天)。有没有我可以使用的 powershell 命令?

enter image description here

【问题讨论】:

    标签: azure netapp


    【解决方案1】:

    根据Azure NetApp Files: PowerShell One-Liners,可以使用Get-AzMetric,提供StartTimeEndTime获取历史数据。

    试试下面取自文档的代码sn-p,例如:

    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 
    

    可以参考PowerShell and CLI for Azure NetApp FilesAzure NetApp Files metrics

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多