• 製品
  • 使用を開始する
  • 関連ドキュメント
  • リソース

Opsgenie を Microsoft Azure と統合する

Microsoft Azure のロゴ

メトリック値に関するアラート ルールの場合、指定されたメトリックの値が割り当てられたしきい値を超えると、アラート ルールがアクティブになり、通知が送信されます。イベントに関するアラート ルールの場合、ルールはすべてのイベントについて、または特定の数のイベントが発生した場合にのみ、通知を送信できます。

​Opsgenie が Azure ユーザーに提供するもの

Azure は、メトリックとイベントに基づいてアラートを生成します。OpsgenieAzure によって生成されたアラートのディスパッチャーとして機能します。Opsgenie は、電子メール、テキスト メッセージ (SMS)、電話、Android および iOS のプッシュ通知を使用して、オンコール スケジュールとエスカレーションに基づいて通知する適切なユーザーを決定します。

Opsgenie は、新しい Azure メトリック アラートもサポートしています。

Azure の新しいメトリック アラートでは、新しい Azure ペイロードに新しいフィールドが追加されます。したがって、Opsgenie 統合をサポートするように設定できます。
詳細については、https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-near-real-time-metric-alerts#payload-schema をご覧ください。

統合の機能性

Azure でアラートが作成されると、統合によって Opsgenie でアラートが自動で作成されます。

Opsgenie で Azure 統合を追加する

この統合はチーム ダッシュボードから追加可能

Opsgenie の Free または Essentials の各プランを使用している、または Jira Service Management の Standard プランで Opsgenie を使用している場合、このプランでは [設定] の [統合] ページが利用できないため、この統合はチーム ダッシュボードからのみ追加できます。

統合をチーム ダッシュボードから追加すると、そのチーム統合の所有者になります。Opsgenie では、この統合を通じて受信したアラートはそのチームのみに割り当てられます。

そのためには、次の手順に従います。

  1. Teams からチーム ダッシュボードに移動します。

  2. [統合] > [統合を追加] の順に選択します。

残りの手順に従って統合を完了します。

  1. [設定] > [統合] の順に移動します。Azure を検索して [追加] を選択します。 

  2. [応答者] フィールドによって Microsoft Azure アラートの通知先を指定します。入力し始めると、オートコンプリートの候補が表示されます。

  3. 統合 URL をコピーします。

  4. [Save Integration (統合の保存)] を選択します。

Azure での設定

注: Azure Webhook アラートは、Azure Preview Portal でのみ使用できます。クラシック バージョンを使用している場合は、電子メール統合を使用してください。

  1. Azure ポータルにログインします。

  2. [監視] セクションの [アラート (クラシック)] を選択します。テキストとアイコンは、リソースによって若干異なる場合があります。アラート (クラシック) が簡単に見つからない場合は、「アラート」または「アラート ルール」の下に表示されることがあります。

Microsoft Azure の設定

3. [メトリック アラート (クラシック) の追加] コマンドを選択し、フィールドに入力します。

4. Opsgenie Azure 統合の URL を Webhook フィールドに貼り付け、ルールを保存します。

Microsoft Azure のアラート

Azure (クラシック) から送信されるペイロードのサンプル

アラートのペイロードを作成します。

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 { "status": "Activated", "context": { "id": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.insights/alertrules/Alert_1_runscope12", "name": "Alert_1_runscope12", "description": "desc", "conditionType": "Metric", "condition": { "metricName": "Memory available", "metricUnit": "Bytes", "metricValue": "1032190976", "threshold": "2", "windowSize": "5", "timeAggregation": "Average", "operator": "GreaterThan" }, "subscriptionId": "1a66ce04-b633-4a0b-b2bc-a912ec8986a6", "resourceGroupName": "montest", "timestamp": "2015-09-18T01:02:35.8190994Z", "resourceName": "helixtest1", "resourceType": "microsoft.compute/virtualmachines", "resourceId": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/Microsoft.Compute/virtualMachines/Helixtest1", "resourceRegion": "centralus", "portalLink": "http://portallink.com" }, "properties": { "hello1": "World1!", "json_stuff": { "type": "critical", "color": "red" }, "customId": "wd39ue9832ue9iuhd9iuewhd9edh", "send_emails_to": "someone@somewhere.com" } }

このペイロードは Opsgenie によって次のように解析されます。

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "status": "Activated", "id": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.insights/alertrules/Alert_1_runscope12", "name": "Alert_1_runscope12", "description": "desc", "condition_type": "Metric", "condition_metric_name": "Memory available", "condition_metric_unit": "Bytes", "condition_metric_value": "1032190976", "condition_threshold": "2", "condition_window_size": "5", "condition_time_aggregation": "Average", "condition_operator": "GreaterThan", "subscription_id": "1a66ce04-b633-4a0b-b2bc-a912ec8986a6", "resource_group_name": "montest", "timestamp": "2015-09-18T01:02:35.8190994Z", "resource_name": "helixtest1", "resource_type": "microsoft.compute/virtualmachines", "resource_id": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/Microsoft.Compute/virtualMachines/Helixtest1", "resource_region": "centralus", "portal_link": "http://portallink.com" }

Azure (最新) から送信されるペイロードのサンプル

アラートのペイロードを作成します。

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 {"schemaId":"AzureMonitorMetricAlert","data": { "version": "2.0", "status": "Activated", "context": { "timestamp": "2018-02-28T10:44:10.1714014Z", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/microsoft.insights/metricAlerts/StorageCheck", "name": "StorageCheck", "description": "", "conditionType": "SingleResourceMultipleMetricCriteria", "condition": { "windowSize": "PT5M", "allOf": [ { "metricName": "Transactions", "dimensions": [ { "name": "AccountResourceId", "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500" }, { "name": "GeoType", "value": "Primary" } ], "operator": "GreaterThan", "threshold": "0", "timeAggregation": "PT5M", "metricValue": 1.0 } ] }, "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "Contoso", "resourceName": "diag500", "resourceType": "Microsoft.Storage/storageAccounts", "resourceId": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500", "portalLink": "https://portal.azure.com/#resource//subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500" }, "properties": { "key1": "value1", "key2": "value2" } } }

このペイロードは Opsgenie によって次のように解析されます。

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "schemaId": "AzureMonitorMetricAlert", "version": "2.0", "status": "Activated", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/microsoft.insights/metricAlerts/StorageCheck", "name": "StorageCheck", "description": "", "condition_type": "SingleResourceMultipleMetricCriteria", "condition_metric_name": "Transactions", "condition_dimensions" : "[{name=AccountResourceId, value=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500}, {name=GeoType, value=Primary}]", "condition_metric_value": "1.0", "condition_threshold": "0", "condition_window_size": "PT5M", "condition_time_aggregation": "PT5M", "condition_operator": "GreaterThan", "subscription_id": "00000000-0000-0000-0000-000000000000", "resource_group_name": "Contoso", "timestamp": "2018-02-28T10:44:10.1714014Z", "resource_name": "diag500", "resource_type": "Microsoft.Storage/storageAccounts", "resource_id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500", "portal_link": "https://portal.azure.com/#resource//subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500" }

 

その他のヘルプ