Opsgenie のテンプレートの作成

Splunk AppDynamicsOpsgenie に HTTP リクエストアクションを送信するには、 でテンプレートを作成する必要があります。Splunk AppDynamics がイベントに応答してアクションをトリガーすると、Opsgenie でアクションの詳細を表示できます。

注: このドキュメントには、Atlassian のドキュメントへの参照が含まれています。Splunk AppDynamics はいかなる権利も所有しておらず、そのようなサードパーティのドキュメントの正確性または完全性について責任を負いません。

はじめる前に

  1. Splunk AppDynamics を Opsgenie と統合します。詳細については、Atlassian Opsgenie ドキュメントを参照してください。
  2. Opsgenie によって生成されたウェブフック URL をコピーし、後で使用するために安全に保管します。Splunk AppDynamics は、この URL を使用してアラートを Opsgenie に送信します。

Create a Template

  1. In the menu bar, click Alert & Respond.
  2. Click HTTP Request Templates.
  3. Enter a name for the template. For example, Send alerts to Opsgenie .
  4. In the Request URL section:
    1. Select POST as Method.
    2. Enter the webhook URL in the Raw URL field.
    3. Select UTF-8 as URL Encoding.
  5. In the Authentication section, select NONE as Type.
  6. In the Payload section:
    1. Select application/json as MIME Type.
    2. Select UTF-8 as Payload Encoding.
    3. Enter the following payload in the text box:
      JSON
      {
      "event_name": "${latestEvent.displayName}",
      "event_guid": "${latestEvent.guid}",
      "event_id": "${latestEvent.id}",
      "policy": "${policy.name}",
      "event_time": "${latestEvent.eventTime}",
      "app_id": "${latestEvent.application.id}",
      "app_name": "${latestEvent.application.name}",
      "event_message": "${latestEvent.eventMessage}",
      "severity": "${latestEvent.severity}",
      "event_deep_link": "${latestEvent.deepLink}",
      "controller_url": "${controllerUrl}",
      "node_id": "${latestEvent.node.id}",
      "node_name": "${latestEvent.node.name}",
      "summary": "${latestEvent.summaryMessage}",
      "event_type": "${latestEvent.eventType}",
      "tier_id": "${latestEvent.tier.id}",
      "tier_name": "${latestEvent.tier.name}"
      #if(${latestEvent.healthRuleEvent} == true)
      ,"health_rule_id": "${latestEvent.healthRule.id}",
      "health_rule_name": "${latestEvent.healthRule.name}",
      "incident_id": "${latestEvent.incident.id}",
      "incident_name": "${latestEvent.incident.name}"
      #end
      }
  7. In the Response Handling Criteria section, click + Add Success Criteria and then:
    1. Select 200 as Status Code.
    2. Select the Expect Payload check box.
    3. Select application/json as Content Type.
  8. In the Settings section, select the One Request Per Event option.
  9. Click Save.