Send notifications using PagerDuty

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

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

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

  • Moogsoft 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 whenever an incident (derived from Moogsoft) gets updated. Moogsoft then updates the corresponding object.

See the PagerDuty documentation for details on PagerDuty components.

Before you begin

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

PagerDuty credentials

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..

  1. Create and save an API key:

    1. In PagerDuty, choose Integrations > API Access Keys > Create New API Key. Enter a description and click Create Key.

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

    3. Copy the API key.

    4. In Moogsoft, go to Settings > Credential Store > Add Credential and choose PagerDuty.

    5. Enter a name for the credentials. Paste the PagerDuty API key that you copied.

  2. Save an integration key:

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

    2. If necessary, click on the triangle next to Incoming Event Source to expand the panel.

    3. Copy the integration key for the default global ruleset (or for a ruleset that you choose, if you have multiple rulesets).

    4. In Moogsoft, paste the integration key into your PagerDuty credentials, and save.

PagerDuty setup

You need these to be configured to accept your Moogsoft data:

  • A PagerDuty service.

  • A PagerDuty event rule to process your Moogsoft data.

Set up a PagerDuty event rule to process Moogsoft alerts and incidents.

  1. In PagerDuty, choose Services > Service Directory and verify that you have a service defined for your Moogsoft data.

  2. Specify a new event rule to enable alert processing:

    1. Choose Automation > Event Rules.

    2. Under Default Global Ruleset or your chosen ruleset, click New Event Rule.

    3. Under When events match these conditions:

      1. Select 'Any'

      2. Type 'payload' into the condition box, and choose 'exists' for the condition.

    4. Under Do these things:

      1. Select Create an incident on a service.

      2. In the right-hand pane under Route to a Service, select the Pager Duty service where you want to route your Moogsoft data.

    5. Save the event rule.

Moogsoft setup

Set up a PagerDuty integration in Moogsoft:.

  1. Go to Data Config > Outbound Integrations > PagerDuty > Add a PagerDuty Integration.

  2. Specify the following:

    1. The PagerDuty credentials you defined in the previous step.

      Note

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

    2. The data types to synchronize -- Incidents, Alerts, or both.

    3. Optionally, you can specify a filter for the objects you want to synchronize with PagerDuty.

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

Bidirectional setup

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

  1. Get a Moogsoft API key. Generate your API key by going to Settings > API Key Management.

  2. In PagerDuty, choose Integrations > Generic Webhooks(v3) > Add Webhook.

  3. For Webhook URL, enter https://moogsoft:<your Moogsoft API key>@api.moogsoft.ai/v1/integrations/pagerduty-webhook, substituting the Moogsoft API key you copied.

  4. For Scope Type, choose Service.

  5. For Scope, choose the PagerDuty service that you configured to receive Moogsoft data.

  6. Enter a description.

  7. Under Events to Send, choose Send all events.

  8. Click Add Webhook and click OK on the Webhook subscription created dialog box when it appears.

  9. Click the View button for the webhook you created, and then click Test Webhook.

  10. Test that events can make a successful round trip by sending a sample event to Moogsoft.

    1. Go to Data Config > Ingestion Services > Events API > cURL Request.

    2. Click the Send (arrow) button below the example curl request.

    3. Go to Monitor > Alerts to verify that an alert was received in Moogsoft .

    4. In PagerDuty, go to Incidents to verify that you have received an incident.

    5. Acknowledge the incident.

    6. In Moogsoft, verify that the status of the alert changed to In Progress.