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

Opsgenie を Amazon EC2 Auto Scaling と統合する

Opsgenie が Amazon EC2 Auto Scaling ユーザーに提供するもの

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

統合の機能性

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

Opsgenie で Amazon EC2 Auto Scaling インテグレーションを追加する

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

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

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

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

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

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

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

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

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

  3. Opsgenie エンドポイントと API キーを含む統合 URL をコピーします。

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

Amazon EC2 Auto Scaling でサブスクリプションを設定する

  1. SNS トピックを作成します

EC2 Auto Scaling トピックの作成

2. Opsgenie インテグレーションから提供された URL を使用して、Opsgenie の API エンドポイントを持つトピックに HTTPS サブスクリプションを追加します

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

Opsgenie への SNS サブスクリプションを正常に設定すると、Opsgenie に確認アラートが作成されます。

3. 作成した SNS トピックに通知を送信するように Auto Scaling グループを設定します

Amazon EC2 Auto Scaling グループ

4. 通知設定を保存した直後に、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" } }



その他のヘルプ