What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. 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

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] (2,404) 2 1

Last change on Apr 28, 2021 9:20:09 AM by  Maike Guba [Paessler Support] (2,404) 2 1



10 Replies

Accepted Answer

Votes:

0

This article applies as of PRTG 22

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

Important: The Events API v2 URL differs depending on the service region of your PagerDuty account. Make sure to use to correct URL in the script in line 6.

Service RegionEvents API v2 URL
UShttps://events.pagerduty.com/v2/enqueue
EUhttps://events.eu.pagerduty.com/v2/enqueue

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.
    1. Name and Description: Provide a name and an optional description for the service and click Next.
      New service name
      Click to enlarge.
    2. Assign an Escalation Policy: Select Generate a new Escalation Policy or Generate a new Escalation Policy and click Next.
      New service name
      Click to enlarge.
    3. Reduce Noise: Select Intelligent for Alert Grouping and Auto-pause incident notifications for Transient Alerts and click Next.
      New service name
      Click to enlarge.
    4. Integrations: Select PRTG Notification for PagerDuty Events API v2 and click Create Service.
      New service name
      Click to enlarge.

Step 2: Configure PRTG

  1. Copy the file PagerDutyEventsV2.ps1 from the .zip file that you have downloaded earlier 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 Template Name to identify the template 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 Executable File, select PagerDutyEventsV2.ps1 from the dropdown list. Then enter the following Parameters: '%device' '%name' '%status' '%down' '%message' '[email protected]' 'Integration_Key'
    Execute Program notification settings
    Click to enlarge.
    Notes:
    • For [email protected], enter a valid user email address within the PagerDuty account.
    • For Integration_Key, sign in to the PagerDuty portal and click the Services tab. Select the service that you created in Step 1: Configure PagerDuty, click the Integrations tab and the icon on the right of the gear wheel on the PRTG Notification For PagerDuty Events API v2 field. You can now see the corresponding integration key for the PRTG configuration. Replace Integration_Key with this key.
    • You need to escape each parameter with single quotes.
  6. Click Create to add the new notification template.
  7. Find your PagerDuty notification template and click the bell icon on the right to send a test notification.
  8. 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] (2,404) 2 1

Last change on Jan 9, 2023 8:15:06 AM by  Jacqueline Conforti [Paessler Support]



Votes:

0

Why is there no reference to the URL to send the web hook to in the Notification Template setup? Shouldn't there be a part of the trigger that incorporates "https://events.pagerduty.com/v2/enqueue". I'm having no luck getting a notification into PagerDuty from PRTG

Created on Sep 23, 2021 7:27:26 AM



Votes:

0

Hello Ben
Unfortunately, the link that you provided seems not to be working on my side. Could you double-check it?
When dealing with notifications there are a lot of steps that need to be taken to properly send it out to the Vendor, in this case, Pager duty.
We need to determine how far you are getting in this process.
In other words, can you confirm the notification is actually being sent out and received at Pager duty? Can you check in Logs/System events/Notification Related, and look for any "error code" or "status ok"?
Feel free to open a support ticket to further investigate this as I believed it would be a lot faster.

Created on Sep 27, 2021 5:32:00 PM by  Luis Quesada (Paessler Technical Support)



Votes:

1

So I get the ok status in PRTG but nothing shows up in PagerDuty. Pagerduty gives me a new URL that is not at all like whats in the script, infact the script URL returns a 404 where the pagerduty one https://events.pagerduty.com/v2/enqueue does not.

Created on Sep 30, 2021 4:02:09 PM



Votes:

0

step 4 not have xxxx value. pagerdut update maybe.

See https://www.screencast.com/t/HRmDStWy7ao

Created on Oct 1, 2021 10:10:14 PM



Votes:

0

Hello Dorian
The image provided seems to be from the Pager duty page. The step you are referring to seems to be a URL. Can you confirm how the URL looks like at this step?
Let me know.
If the documentation needs to be updated,We will be happy to proceed.

Created on Oct 6, 2021 8:37:39 PM by  Luis Quesada (Paessler Technical Support)



Votes:

0

This documentation seems to be out of date, and I can't get it to work.

1. On step 3 on the Add A Service page (now called Create a Service), there is no "Use our API directly" option. The first page only has a Name and Description field. Page 2 lets you select an escalation policy or create a new one. Page 3 lets you select an integration, however Use our API directly is not an option. One of the selectable options is named 'Events API v2' and another one (if you search) is called 'PRTG Notification For PagerDuty Events API v2' which seems promising, but not at all what this documentation describes. Incidentally if you add that integration, there's a documentation link which leads to this page.

2. On step 5, the developer tools menu is gone completely, however you can find 'API Access Keys' inside a new menu item named 'Integrations' which lets you generate an API key

3. If you examine the PagerDuty.ps1 script, it links to the URL "https://api.pagerduty.com/incidents", but the PagerDuty page lists the integration URL as "https://events.pagerduty.com/v2/enqueue" -- should we be editing the script for the URL specified in the integration or leaving it as provided?

I have tried both of the listed integration types, at both of the URLs and while I can see script running and the web queries going out (looking at it in Wireshark) so far I have not been able to see anything actually come into PagerDuty, and the return traffic from PagerDuty is [ACK, RST] like the server is saying I got your message but I'm not interested.

Created on Jan 7, 2022 3:41:52 PM



Votes:

0

Hello Andrew
I'll be reporting this issue and have this KB link updated asap.
Thank you for letting us know.

Created on Feb 1, 2022 12:06:54 AM by  Luis Quesada (Paessler Technical Support)

Last change on Feb 1, 2022 12:07:32 AM by  Luis Quesada (Paessler Technical Support)



Votes:

0

Does anyone know if something with pagerduty has changed? I've tried multiple times to setup this integration multiple times and pagerduty never shows that it's received anything from PRTG even though PRTG is showing it's successfully executing the powershell script.

Created on Jan 23, 2023 3:48:30 PM



Votes:

0

Hello there.
Thanks for your question
Yes, the Pager duty page was recently updated with more information, The last update was done on Jan the 9th 2023.
If you are not getting any error from PRTG then it would be advised to contact Pager duty support, and then see what's actually being sent to them and how they are handling this information.

Created on Jan 23, 2023 7:08:01 PM by  Luis Quesada (Paessler Technical Support)




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.