Microsoft Teams のテンプレートの作成

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

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

はじめる前に

  1. Microsoft Teams でチャネルを作成し、適切な名前を付けます。たとえば、Splunk AppDynamics Alerts などです 。このチャネルは、Splunk AppDynamics からアラートを受信するために使用されます。Microsoft Teams のドキュメントを参照してください。 https://support.microsoft.com/en-us/office/create-a-team-from-scratch-in-microsoft-teams-174adf5f-846b-4780-b765-de1a0a737e2b
  2. Microsoft Teams で作成したチャネルへの受信ウェブフックを作成します。Microsoft Teams のドキュメントを参照してください。 https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook?tabs=newteams%2Cdotnet
  3. Microsoft Teams のウェブフック URL をコピーし、後で使用するために安全に保管します。Splunk AppDynamics は、この URL を使用してアラートを Microsoft Teams に送信します。

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 Microsoft Teams .
  4. In the Request URL section:
    1. Select POST as Method.
    2. Enter the webhook URL in the Raw URLfield.
    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
      {
      "@context": "http://schema.org/extensions",
      "@type": "MessageCard",
      "title": "Event Detected for ${latestEvent.application.name} on node
      ${latestEvent.node.name}",
      "text": "${latestEvent.displayName} - ${latestEvent.eventTime} :
      ${latestEvent.eventMessage} ",
      "themeColor": "#if($latestEvent.severity == "INFO")0075FF#elseif($latestEvent.severity ==
      "WARN" )ff9500#elseif($latestEvent.severity == "ERROR" )ff3b30#end", "sections": [
      {
      "activityTitle": "Severity: $latestEvent.severity",
      "images": [ {
      "image":"${latestEvent.severityImage.deepLink}"
      } ]
      }, {
      "value": "[here](${latestEvent.deepLink})" },
      {
      "facts": [
      {
      "name": "View Event",
      "value": "[click here](${latestEvent.deepLink})",
      },
      {
      "name": "Open Controller",
      "value": "[click here](${controllerUrl} )" }
      ] },
      ] }
  7. In the Settings section, select the One Request Per Event option.
  8. Click Save.