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

Opsgenie を Amazon EC2 Auto Scaling と統合する

概要

統合でできるようになること

Amazon EC2 Auto Scaling は、SNS を通じてスケール変更イベントの通知を送信します。Opsgenie はこれらの通知のディスパッチャーとして機能して、オンコール スケジュールに基づいて適切な通知先を決定します。メール、テキスト メッセージ (SMS)、電話、iPhone、Android のプッシュ通知によって通知して、アラートが承認されるかクローズされるまでアラートをエスカレートします。

統合による機能

Amazon EC2 Auto Scaling でアラートが作成されると、統合を通じて Opsgenie でアラートが自動的に作成されます。

統合をセットアップする

Amazon EC2 Auto Scaling は API ベースの統合です。セットアップするには、次の手順に従います。

  • OpsgenieAmazon EC2 Auto Scaling 統合を追加する

  • Amazon EC2 Auto Scaling でサブスクリプションをセットアップする

Amazon EC2 Auto Scaling 統合を追加する

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

  1. [チーム] に移動して自分のチームを選択します。

  2. 左側のナビゲーションで [統合] を選択し、[統合を追加] を選択します。

統合をチーム ダッシュボードから追加すると、そのチーム統合の所有者になります。Opsgenie では、この統合を通じて受信したアラートはそのチームのみに割り当てられます。このセクションの残りの手順に従って、統合を設定してください。

OpsgenieAmazon EC2 Auto Scaling 統合を追加するには:

  1. [設定] > [統合] の順に移動します。

  2. [統合を追加] を選択します。

  3. 検索を実行して「Amazon EC2 Auto Scaling」を選択します。

  4. 次の画面で、統合の名前を入力します。

  5. オプション: 特定のチームが統合からのアラートを受信するようにする場合は、[Assignee team (担当者チーム)] のチームを選択します。

  6. [続行] を選択します。
    この時点で、統合が保存されます。

  7. [Steps to configure the integration (統合を設定するステップ)] セクションを展開して、Opsgenie のエンドポイントと API キーを含む統合 URL をコピーします。
    この URL は、後ほど Amazon EC2 Auto Scaling で統合を設定する際に使用します。

  8. [統合をオンにする] を選択します。
    統合のために作成したルールは、統合をオンにした場合にのみ機能します。

Amazon EC2 Auto Scaling でサブスクリプションをセットアップする

1. SNS トピックを作成します。
詳細については、「Getting started with Amazon SNS (Amazon SNS を使い始める)」を参照してください。

2. Opsgenie で統合を追加する際にコピーした URL をエンドポイントとして使用して、トピックに HTTPS サブスクリプションを追加します。

EC2 Auto Scaling サブスクリプションの作成

設定が正常に完了すると、Opsgenie で確認のアラートが作成されます。HTTPS サブスクリプションを追加する方法の詳細については、「What is an Amazon SNS? (Amazon SNS とは)」を参照してください。

3. 作成した SNS に通知を送信するように Auto Scaling グループを設定します。
詳細については、「What is EC2 Auto Scaling? (EC2 Auto Scaling とは)」を参照してください。

通知設定を保存した後に、Auto Scaling はアラートを作成するテスト通知を Opsgenie に送信します。

Amazon EC2 Auto Scaling から送信されるペイロードの例

アラート ペイロード (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 { "Type": "Notification", "MessageId": "1cf7a0eb-4179-4181-b15b-ea22c5aa0280", "TopicArn": "arn:aws:sns:us-east-1:3779xxxxxx:otoSkeyl", "Subject": "Auto Scaling: test notification for group \"otoskeylGroup\"", "Message": { "StatusCode": "InProgress", "Service": "AWS Auto Scaling", "AutoScalingGroupName": "otoskeylGroup", "Description": "Launching a new EC2 instance: i-257654cf", "ActivityId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "Event": "autoscaling:EC2_INSTANCE_LAUNCH", "Details": { "Availability Zone": "us-east-1d" }, "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:37797zxxxxx:autoScalingGroup:59016df3-65d4-4d06-95ba-xxxxxx0:autoScalingGroupName/otoskeylGroup", "Progress": 50, "Time": "2014-12-01T12:30:12.513Z", "AccountId": "377976xxxxx", "RequestId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "StatusMessage": "statusmesic", "EndTime": "2014-12-01T12:30:12.513Z", "EC2InstanceId": "i-257654cf", "StartTime": "2014-12-01T12:29:38.644Z", "Cause": "At 2014-12-01T12:29:29Z a user request update of AutoScalingGroup constraints to min: 1, max: 2, desired: 2 changing the desired capacity from 1 to 2. At 2014-12-01T12:29:37Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 1 to 2." }, "Timestamp": "2014-12-01T09:48:46.429Z", "SignatureVersion": "1", "Signature": "XrsO2wtE0b+xxxxxx1fMuv07uRttlimTUg+rV4U9RmNSSBEdlmyWvtGgpjebsmNv1wkjUsBQOJZjZnpZp5FBn6quAn3twNdRMmMLf15lv6ESbYF8xxxxxxxxxjj/ZLwiH9Pr/cxVYOR0aPQBPDwTYn8w6g=", "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfxxxxxxxxxx", "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:089311xxxxx:CloudWatchHTTPAlarms:1841c5ca-ddda-450e-bbfb-xxxxxxx" }

Opsgenie によって解析されたペイロード (JSON 形式)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "AutoScalingGroupName": "otoskeylGroup", "Service": "AWS Auto Scaling", "Time": "2014-12-01T12:30:12.513Z", "AccountId": "37797xxxxxx", "Event": "autoscaling:EC2_INSTANCE_LAUNCH", "RequestId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:377976xxxxxxx:autoScalingGroup:xxxxxx-65d4-4d06-95ba-93403737f3d0:autoScalingGroupName/otoskeylGroup", "StatusCode": "InProgress", "Description": "Launching a new EC2 instance: i-257654cf", "ActivityId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "Progress": 50, "StatusMessage": "statusmesic", "EndTime": "2014-12-01T12:30:12.513Z", "EC2InstanceId": "i-257654cf", "StartTime": "2014-12-01T12:29:38.644Z", "Details": { "Availability Zone": "us-east-1d" } }



その他のヘルプ