2016-09-19 14 views
0

私はダッシュボードアプリケーション(Webアプリケーション)にAzureリクエストを使用してライブ監視用のAzureメトリックを統合しようとしています。休憩リクエストを使用してAzureモニタリングデータを取得できません

私が作ったこのサンプル要求:

url:https://management.azure.com/subscriptions/XXXXXX-XXXX-XXXX-XXXX-XXXXX/resourceGroups/pwcdfp/providers/microsoft.insights/alertrules/test?api-version=2016-03-01 

がペイロード:あなたが最初Azureの監視データを取得する方法を尋ねたが、その後の警告を記述するので

{ 
    "id": "/subscriptions/b3728f4e-cba5-44e2-bf02-b03e7fd1d94e/resourceGroups/pwcdfp/providers/microsoft.insights/alertrules/test", 
    "name": "test", 
    "type": "Microsoft.Insights/alertRules", 
    "location": "southeastasia", 
    "tags": { 
     "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage", 
     "hidden-link:/subscriptions/b3728f4e-cba5-44e2-bf02-b03e7fd1d94e/resourceGroups/pwcdfp/providers/Microsoft.ClassicCompute/virtualMachines/pwcdfp": "Resource" 
    }, 
    "properties": { 
     "name": "test", 
     "description": "test", 
     "isEnabled": true, 
     "condition": { 
      "$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ThresholdRuleCondition, Microsoft.WindowsAzure.Management.Mon.Client", 
      "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", 
      "dataSource": { 
       "$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleMetricDataSource, Microsoft.WindowsAzure.Management.Mon.Client", 
       "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", 
       "resourceUri": "/subscriptions/b3728f4e-cba5-44e2-bf02-b03e7fd1d94e/resourceGroups/pwcdfp/providers/Microsoft.ClassicCompute/virtualMachines/pwcdfp", 
       "metricName": "Disk Read Bytes/sec" 
      }, 
      "threshold": 1, 
      "windowSize": "PT5M", 
      "timeAggregation": "Average" 
     }, 
     "lastUpdatedTime": "2016-09-19T05:34:38.6351894Z", 
     "provisioningState": "Succeeded", 
     "actions": [] 
    } 
} 

content type: application/json 
Authorization token: 

SharedAccessSignature uid=57d95d630ac0d2007b030003&ex=2016-09-17T09:10:00.0000000Z&sn=F3s+t2ufw76Bmh9SuoYYnF4zek0v/2jz7NXbLYssk1vwnMhcAeNxLwiA1Sg2Q5aEiQw/yPPYrmVNJbaiJOC61g== 
+0

申し訳ありませんリクエストURLは次のとおりです:https://management.azure.com/subscriptions/b3728f4e-cba5-44e2-bf02-b03e7fd1d94e/resourceGroups/pwcdfp/providers/microsoft.insights/alertrules/test?api-version= 2016-03-01 –

答えて

0

質問は、少し不明です、これは、監視データに基づいて行われるアクションです。 Classic Compute VMから定期的にメトリックデータを取得しようとしている場合、アラートは正しい方法ではありません。アラートは、特定のしきい値が満たされた場合にのみ発生します。代わりに、.NET SDKを使用してそのデータを取得できます。

今日、このSDKを使用するメトリクスはすべてのリソースで提供されているわけではありません。特にClassic Compute VMの場合、Azure Diagnosticsを有効にしていない限り、メトリックは受信されません。これは、VMのAzureポータルのブレードに移動し、「診断」に移動して「基本メトリック」をチェックすることで実行できます。

関連する問題