What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How can I use the PagerDuty Events API v2 with notifications in PRTG?

Votes:

0

Your Vote:

Up

Down

I want to use a PowerShell script to set up a notification in PRTG to send alerts using the PagerDuty Events API v2. Which steps do I have to take?

api execute-program notifications pagerduty prtg

Created on Apr 28, 2021 7:38:49 AM by  Maike Guba [Paessler Support]

Last change on Apr 28, 2021 9:20:09 AM by  Maike Guba [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

Your Vote:

Up

Down

This article applies as of PRTG 21

How to use the PagerDuty Events API v2 with notifications in PRTG

This how-to guide explains how to set up a PowerShell script-based notification method Execute Program in PRTG to send alerts using the PagerDuty Events API v2. The instructions show a generic catch all service and notification but you can adapt them to work with any defined PagerDuty service or a specific device or sensor in PRTG.

You can download the PowerShell script here: https://gitlab.com/PRTG/notification-scripts/prtg-notification-for-pagerduty-events-api-v2

Step 1: Configure PagerDuty

  1. Sign in to the PagerDuty portal and click the Services tab.
    PagerDuty Services tab
    Click to enlarge.
  2. Click New Service.
    New Service button
    Click to enlarge.
  3. Provide a name and an optional description for the service. Under Integration Type, select Use our API directly, then select Events API v2 from the dropdown list. Click Add Service.
    Add a Service dialog
    Click to enlarge.
  4. PagerDuty now displays the settings for the newly defined service. The URL bar shows the path to the service in the format https://youraccountname.pagerduty.com/service-directory/XXXXXXXX XXXXXXX is a random alphanumeric string. This is the Service ID. Note down the string.
  5. Click the Developer Tools button in the menu bar and select API Access.
    Developer Tools menu
    Click to enlarge.
  6. Click Create New API Key.
    New API Key button
    Click to enlarge.
  7. In the Create API Key dialog, enter a description for the new API call and click Create Key.
    Create Key button
    Click to enlarge.
  8. Note down the API key. This is the only opportunity to copy the key as PagerDuty does not show it again.
    New API Key dialog
    Click to enlarge.

Step 2: Configure PRTG

  1. Copy the file PagerDuty.ps1 to the \Notifications\EXE subfolder of the PRTG program directory.
  2. Log in to the PRTG web interface and navigate to Setup | Account Settings | Notification Templates.
    PRTG Setup main menu bar
    Click to enlarge.
  3. Click the plus button and select Add Notification Template.
    Add Notification Template button
    Click to enlarge.
  4. Enter a meaningful Template Name and select the appropriate Notification Summarization settings.
    Add Notification Template dialog
    Click to enlarge.
  5. Scroll down to the notification methods and enable Execute Program. As Program File, select PagerDuty.ps1 from the dropdown list. Then enter the following Parameters: '%device' '%name' '%status' '(%message)' '[email protected]' 'API_KEY' 'SERVICE_ID'
    Note: For [email protected], enter a valid user email address within the PagerDuty account. Replace 'API_KEY' and 'SERVICE_ID' with the values that you noted down during the PagerDuty configuration.

    Note: You need to escape each parameter with single quotes.
    Execute Program notification settings
    Click to enlarge.
  6. Click Create to add the new notification template.
  7. Add notification triggers to sensors or devices as required and use the newly created PagerDuty API notification template.

Created on Apr 28, 2021 8:21:30 AM by  Maike Guba [Paessler Support]

Last change on Apr 30, 2021 2:39:12 PM by  Maike Guba [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.