Send notifications using PagerDuty

This integration enables you to receive just-in-time PagerDuty notifications when alerts or incidents get updated in Moogsoft Cloud.

The Moogsoft Cloud PagerDuty integration supports both the v2 and v3 versions of PagerDuty APIs.

This is a bidirectional integration in which the two systems synchronize their alerts and incidents:

  • Moogsoft Cloud notifies PagerDuty when it creates an alert or incident. PagerDuty then creates a new corresponding object.

  • Moogsoft Cloud notifies PagerDuty whenever it updates an alert or incident. PagerDuty then updates the corresponding object.

    The following events trigger an update in PagerDuty:

    • Incident status update

    • Incident severity update

    • Alert status update

    • Alert severity update

  • PagerDuty notifies Moogsoft Cloud whenever an incident (derived from Moogsoft Cloud ) gets updated. Moogsoft Cloud then updates the corresponding object.

See the PagerDuty documentation for details on PagerDuty components.

Before you begin

This integration was validated with PagerDuty on May 11, 2022. Before you start to set up your integration, make sure that you have the necessary PagerDuty permissions to create API keys and webhook integrations.

Save your PagerDuty credentials in Moogsoft Cloud

To send data to PagerDuty, you need the following credentials:

  • A PagerDuty API key

  • A PagerDuty integration key

Generate PagerDuty credentials and save them in Moogsoft Cloud:

  1. Create and save a PagerDuty API key:

    1. In PagerDuty, navigate to Integrations > API Access Keys.

    2. Click Create a New API Key.

    3. Enter a description and then click Create Key.

      Copy the API key when it displays.

    4. Check the table in API Access Keys. Make sure the access level is Full access.

    5. In Moogsoft Cloud, navigate to Settings > Credential Store.

    6. Click Add Credential and then select PagerDuty from the list.

    7. Enter a name for the credential and then paste the PagerDuty API key that you copied in the API Key field.

  2. Save an integration key:

    1. In PagerDuty, navigate to Automation > Event Rules.

    2. Click a ruleset on the page.

    3. If the integration key does not display on the ruleset page, click the text Incoming Event Source.

    4. Copy the integration key.

    5. In Moogsoft Cloud, paste the integration key into your PagerDuty credentials, and then click Save.

Add a rule to PagerDuty

For PagerDuty to accept Moogsoft Cloud data, you must have the following configured:

Add a PagerDuty event rule to process Moogsoft Cloud alerts and incidents:

  1. Navigate to Automation > Event Rules.

  2. Click the ruleset you selected in the previous procedure.

  3. On the ruleset page, click New Event Rule.

  4. In the section "When events match these conditions," select Any in the line "Run this rule when All/Any of the following conditions are met."

  5. Type payload into the first condition box and select exists for the condition.

  6. Click Do these things to open the section and then select Create an incident on a service.

  7. In the right-hand pane under Route to a Service, select the PagerDuty service where you want to route your Moogsoft Cloud data.

  8. Click Save Rule.

Configure the integration in Moogsoft Cloud

Set up the PagerDuty integration in Moogsoft Cloud:

  1. In Moogsoft Cloud, navigate to Data Config > Outbound Integrations.

  2. Click PagerDuty, and then click Add a PagerDuty Integration.

  3. Enter a name for the integration.

  4. Under Credentials, click the down arrow and select the PagerDuty credentials you added earlier.

    If you have not already added them, click Add New Credentials and add your credentials now.

    Note

    After you select your credentials, click TEST to verify that Moogsoft Cloud can communicate with your PagerDuty instance.

  5. Under Data Type, select the data you want to synchronize with PagerDuty.

    Select Incidents, Alerts, or both.

  6. Optionally, configure a filter for the objects you want to synchronize with PagerDuty.

  7. Test and save the integration. Verify that the test incident was received in PagerDuty.

Add a PagerDuty webhook

Perform these steps if you want PagerDuty to notify Moogsoft Cloud when an alert or incident (derived from Moogsoft Cloud) gets updated.

You can choose to add either a v2 or v3 webhook as Moogsoft Cloud supports both versions.

Add a v2 webhook

  1. In PagerDuty, navigate to Integrations > Extensions.

  2. Click New Extension and configure the options as follows:

    1. Extension Type: Generic V2 Webhook

    2. Name: Enter a name for your webhook.

    3. Service: Select the name of the PagerDuty service that will send webhooks to Moogsoft Cloud.

    4. In the Details box, enter the URL information to construct the webhook URL.

      The URL follows this format:

      https://moogsoft:<your_Moogsoft_API_key>@api.moogsoft.ai/pagerduty-webhook

      Obtain a Moogsoft Cloud API key
      1. In Moogsoft Cloud, navigate to Settings > API Key Management.

      2. Click + Create API Key.

      3. Enter a name and description, and then click Create.

      4. Copy the API key when it displays. Go back to PagerDuty and paste it in the PagerDuty Webhook URL, replacing <your_Moogsoft_API key> where indicated above.

    5. Click Save.

Add a v3 webhook

  1. In PagerDuty, navigate to Integrations > Generic Webhooks (v3).

  2. Click New Webhook.

  3. In the Webhook URL box, enter the URL information to construct the webhook URL.

    The URL follows this format:

    https://moogsoft:<your_Moogsoft_API_key>@api.moogsoft.ai/v1/integrations/pagerduty-webhook/<Moogsoft_Integration_ID>

    The next two procedures explain how to locate the information to complete this URL:

    Obtain a Moogsoft Cloud API key
    1. In Moogsoft Cloud, navigate to Settings > API Key Management.

    2. Click + Create API Key.

    3. Enter a name and description, and then click Create.

    4. Copy the API key when it displays. Go back to PagerDuty and paste it in the PagerDuty Webhook URL, replacing <your_Moogsoft_API key> where indicated above.

    Obtain the Moogsoft Cloud integration ID
    1. In Moogsoft Cloud, navigate to Data Config > Outbound Integrations.

    2. Click PagerDuty, and then click the entry for your PagerDuty integration.

    3. Find the integration ID. In the location field of your browser, after clicking your integration name, the ID for your integration displays as the last part of the URL.

      For example, if your integration URL is https://api.moogsoft.ai/999999999999/#/outbound/pagerduty/configure/abcdabcdabcdabcdabcdabcd, then your integration ID is abcdabcdabcdabcdabcdabcd.

    4. Copy the Integration ID from the URL. Paste it in the PagerDuty Webhook URL, replacing <Moogsoft_Integration_ID> where indicated above.

  4. From the Scope Type menu, select Service.

  5. From the Scope menu, select the name of the PagerDuty service that will send webhooks to Moogsoft Cloud.

  6. Make any changes to the select event subscriptions.

    At minimum, you must select the following options:

    • incident.acknowledged

    • incident.resolved

    • incident.triggered

    • incident.reassigned

  7. Click Add Webhook.