Skip to main content

Send notifications to Opsgenie

You can configure Moogsoft Cloud to forward incidents to an Opsgenie team using an outbound webhook integration.

Before you begin

Before you set up your Opsgenie outbound integration:

  • Make sure you are signed into your Moogsoft instance.

  • Make sure you are signed into Opsgenie.

Set up an inbound integration in Opsgenie

  1. Open Opsgenie. From the top menu, click Teams.

  2. Choose or create the team that will be responsible for the Moogsoft integration.

  3. From the team page, navigate to Integrations > Add integration.

  4. Click the API tile.

  5. Provide a unique name for the integration, such as "Moogsoft."

  6. Click Continue.

  7. On the Integrations settings page of your new integration, copy the API key and save it for use later on.

  8. Click Edit to check your Integration settings.

  9. In the Edit integration settings window that appears, verify that Allow Create and Update Access is enabled.

  10. Click Save.

  11. Click Turn on Integration.

Configure the CREATE webhook in Moogsoft

Once you have finished configuring the properties in Opsgenie, you must create new outbound incident webhooks in Moogsoft in order to send data to Opsgenie. This section explains how to set up the Opsgenie CREATE webhook, which creates new incidents in Opsgenie when incidents are processed in Moogsoft.

To configure the CREATE webhook:

  1. Log into Moogsoft and navigate to Integrations > Outbound Integrations > Incident Webhook.

  2. Click Add an Incident Webhook and enter "Opsgenie CREATE" as the name of the webhook. Optionally, provide a description.

  3. Complete each section of the webhook according to the following:

    1. Skip the Triggers section.

    2. Configure the Endpoint:

      1. Set the request method to POST.

      2. Under URL, copy and paste the following:

        https://api.opsgenie.com/v2/alerts
      3. Under Authorization, select No auth. This should already be the default value.

      4. Under Headers, add a new row with the following parameters. Replace <Opsgenie API Key> with the API key that you copied from Opsgenie:

        • Key: Authorization

        • Value: GenieKey <Opsgenie API Key>

    3. Specify the Payload Body:

      1. Replace the default payload with the following:

        {"description":"Moogsoft Issue #$id with severity $severity and description $description at $incident_url is $status", "message":"$description"}
      2. Scroll up to the top of the page and click Test in the upper right-hand corner. You should see response details and a confirmation that the webhook is configured correctly.

      3. Make additional payload adjustments according to your business needs. To learn more about fine-tuning your outbound payload, read Configure the CREATE payload body for an incident webhook.

    4. Save the webhook.

Configure the UPDATE webhook in Moogsoft

Next, create an Opsgenie UPDATE webhook, which updates Opsgenie incidents when their corresponding Moogsoft incidents are updated.

To configure the UPDATE webhook:

  1. Navigate to Integrations > Outbound Integrations > Incident Webhook.

  2. At the far right side of the "Opsgenie CREATE" webhook you just configured, click on the copy icon:

    OpsgenieDuplicate.png
  3. Enter "Opsgenie UPDATE" for the name of the duplicate webhook and click Duplicate.

  4. Click on the "Opsgenie UPDATE" webhook to open it.

  5. Click Edit.

  6. Under the Triggers section, select the conditions that you would like to trigger the webhook.

  7. Skip to the Payload Body section:

    1. Replace the existing payload with the following:

      {"description":"Updated Moogsoft Issue #$id with severity $severity and description $description is $status", "message":"$description"}
    2. Scroll up to the top of the page and click Test in the upper right-hand corner. You should see response details and a confirmation that the webhook is configured correctly.

    3. Make additional payload adjustments according to your business needs. To learn more about fine-tuning your outbound payload, read Configure the CREATE payload body for an incident webhook.

  8. Save the webhook.

Configure the CREATE workflow in Moogsoft

Configure an incident workflow called Opsgenie CREATE Workflow, which triggers the "Opsgenie CREATE" webhook when an incident is created in Moogsoft.

To configure the CREATE workflow:

  1. Navigate to Correlate & Automate > Workflow Engine > Incident Workflows.

  2. Click Add Workflow and enter "Opsgenie CREATE Workflow" as the name of the workflow. Optionally, provide a description.

  3. For the Trigger, select Create.

    If desired, add a filter condition on the incidents that you wish to forward to Opsgenie.

  4. Click Add Action, select the Send to Endpoint action and then click Add Selected Action.

  5. Select the new Send to Endpoint action complete each section according to the following:

    1. Webhook: Select the "Opsgenie CREATE" outbound incident webhook that you created earlier.

    2. External Link: Skip this section.

    3. Integration Name: Enter the following (without quotes): "Opsgenie Integration"

      Skip all remaining sections.

  6. Save and Enable the workflow.

Configure the UPDATE workflow in Moogsoft

Finally, configure another incident workflow called Opsgenie UPDATE Workflow, which triggers the "Opsgenie UPDATE" webhook to send data when an incident is updated in Moogsoft.

To configure the UPDATE workflow:

  1. Navigate to Correlate & Automate > Workflow Engine > Incident Workflows.

  2. Click Add Workflow and enter "Opsgenie UPDATE Workflow" as the name of the workflow. Optionally, provide a description.

  3. For the Trigger, select Update.

  4. Click Add Action, select the Send to Endpoint action and then click Add Selected Action.

  5. Select the new Send to Endpoint action and complete each section as follows:

    1. Webhook: Select the "Opsgenie UPDATE" outbound incident webhook that you created earlier.

    2. External Link: Skip this section.

    3. Integration Name: Enter the following (without quotes): "Opsgenie Integration"

      Skip all remaining sections.

  6. Save and Enable the workflow.

Test the integration

  1. Navigate to Integrations > Ingestion Services > Events API.

  2. Add your API key to the provided cURL command and run the command in an external terminal to send an event to Moogsoft.

  3. Verify that an incident has been created in Moogsoft.

  4. Within Opsgenie, verify that an incident notification has arrived. You should also see the test notification(s) you sent earlier.

  5. If you have enabled updates and included Status changed as a trigger, close the incident in Moogsoft and verify in Opsgenie that an update notification has arrived.