0

我試圖使用命令AWS CloudWatch的獲取度量獲得「DiskSpaceUtilization」,但結果是空..AWS CloudWatch的get.metrics與多個維度

"Datapoints": [], 
"Label": "DiskSpaceUtilization" 

我注意到,如果我使用

aws cloudwatch list-metrics --namespace mymetric 

度量具有多個維度!

 "Namespace": "mymetric", 
     "Dimensions": [ 
      { 
       "Name": "MountPath", 
       "Value": "/" 
      }, 
      { 
       "Name": "InstanceId", 
       "Value": "i-aaaaaaa" 
      }, 
      { 
       "Name": "Filesystem", 
       "Value": "/dev/xvda1" 
      } 
     ], 
     "MetricName": "DiskSpaceUtilization" 

有人知道如何檢索此度量標準嗎?我必須在命令中加入多少維度?

謝謝!

回答

0

最後我找到了解決辦法..

aws cloudwatch get-metric-statistics --namespace MyCustomMetric --metric-name DiskSpaceUtilization --dimensions Name="MountPath",Value="/dev" Name="InstanceId",Value="i-XXXXX" Name="Filesystem",Value="devtmpfs" --start-time 2016-12-23T7:10 --end-time 2016-12-23T7:20 --period 600 --statistic Average