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 do I create a webhook for the PRTG notifications to Slack and Microsoft Teams?

Votes:

1

To get notified via Slack or Microsoft Teams, I need to provide a webhook in the PRTG notification settings. How do I get webhooks for Slack and Microsoft Teams?

microsoft-teams notifications prtg slack webhook

Created on Jun 19, 2018 4:06:59 PM by  Martina Wittmann [Paessler Support]

Last change on Jun 15, 2022 10:55:25 AM by  Brandy Greger [Paessler Support]



12 Replies

Accepted Answer

Votes:

1

This article applies as of PRTG 24.3.99

How to configure webhooks for PRTG notifications to Slack and Microsoft Teams

To communicate with your messaging application, PRTG needs an address to send the notification information to. This address is the URL of the webhook that you need to provide in the Slack or Microsoft Teams notification setup in PRTG under Setup | Account Settings | Notification Templates.

The webhook URL is created upon request by your messaging application. Go to your Slack or Teams workspace and create a webhook for your channel.

How to create a webhook for Slack

  1. In your Slack app, go to the settings page and follow the instructions from the Slack API documentation: Sending messages using incoming webhooks.
  2. Copy the Slack webhook and paste it in the Slack Webhook URL field under the Send Slack Message setting in PRTG.

A notification that PRTG sends could look like the following in Slack:

Message in Slack
Click to enlarge.

How to create a webhook for Microsoft Teams

  1. Open Microsoft Teams, go to the Workflows app and click on the Create tab.
  2. Choose the template Post to a channel when a webhook request is received. For more information about the Workflows app in Microsoft Teams, see Microsoft Support: Browse and add workflows in Microsoft Teams.
  3. Set up and add your workflow. For more information, see Microsoft Support: Post a workflow when a webhook request is received in Microsoft Teams.
  4. The app displays a URL after you successfully created the workflow. Copy this URL and paste it in the Teams Webhook URL field under the Send Microsoft Teams Message setting in PRTG.

A notification that PRTG sends could look like the following in Microsoft Teams:

Message in Teams
Click to enlarge.

More

Created on Jul 2, 2018 8:39:53 AM by  Martina Wittmann [Paessler Support]

Last change on Aug 5, 2024 10:57:55 AM by  Jacqueline Conforti [Paessler Support]



Votes:

0

This looks nice, any chance of also supporting Webex Teams? It also has incoming webhook support (see https://bit.ly/2LMAdvY) so should be fairly similar.

Created on Aug 3, 2018 9:26:47 AM



Votes:

0

Hi there,

You can use the "HTTP Action" in the Notifications under "Setup > Account Settigns > Notifications" for almost all HTTP-APIs. I don't see a reason why you wouldn't be able to send a notification to Cisco Webex as the Calls are simple HTTP Calls.

Best regards.

Created on Aug 3, 2018 9:29:32 AM by  Dariusz Gorka [Paessler Support]



Votes:

3

I created a method to send notifications to WebEx Teams, here's how:

1) Create a WebEx Teams webhook space and note the space's number

2) On the PRTG server, copy/paste the code below into C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE\webex-teams-notification.ps1

#
# Notification trigger for PRTG to send notifications to a WebEx Teams space
#
# Usage: webexteams-notifications.ps1 <WebEx Teams space number> <message from PRTG>
#

# The next line receives all command line args and splits out the first arg as $teamsSpace and shifts the array so all remaining
# args are assigned to $teamsMessage, as this can vary in number of elements.
# See: https://devblogs.microsoft.com/powershell/powershell-tip-how-to-shift-arrays/
$teamsSpace, $teamsMessage = $args
# URL to send the message to
$teamsUri      = "https://api.ciscospark.com/v1/webhooks/incoming/$teamsSpace"

# Where the magic happens
Invoke-WebRequest -Method 'POST' -ContentType "application/json" -Body "{`"text`" : `"$teamsMessage`"}" $teamsUri

3) In the PRTG web interface, go to Setup -> Account Settings --> Notification Templates, then select Add Notification Template

4) Give it a user-friendly name, then scroll down and toggle Execute Program and select the PowerShell script you created in step #2

5) Leave the existing Parameters values, but pre-pend the Team space number to be the first value

6) Select Create

7) Apply the new notification template to whatever PRTG object you'd like

8) Test it out, then feel #accomplished

Created on Oct 22, 2019 3:05:50 PM



Votes:

2

Hi there,

Thanks a lot for sharing this. We appreciate your work.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Oct 22, 2019 4:31:07 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Hi ryebread157,

thanks for your afford to create this code! We tried to enable this for our Webex Teams as well, but sadly it is not working. Maybe we are making a mistake... Can you maybe get a little bit more specific on step 5?

Thanks in advance!

Created on Nov 20, 2019 12:18:30 PM



Votes:

0

Just wanted to add to this as I found I was having trouble calling an Azure webhook and eventually realised the issue was that the built-in option only supports HTTP and I needed to make the call on HTTPS.

I've added the following script as C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE\Webhook.ps1:

param (
    [Parameter(Mandatory=$true,Position=0)][String]$Token
)

$Domain = "https://s12events.azure-automation.net/"
$Uri = ($Domain + "webhooks?token=" + $Token)

Invoke-Webrequest -Method POST -Uri $Uri

I've then put the token in the comments for the "Device" and so can pass it through as an argument as per this screenshot. This now successfully calls the Azure webhook and I've been able to apply it to multiple sensors.

Created on Dec 12, 2019 3:15:59 PM



Votes:

0

@ryebread157

I have attempted to use your script as well however I am having difficulties in it's application.

After applying the exe and prepending my Webex Teams space ID to the notification template I simulated an outage however I am receiving an error message of where <servername> is the name of the server removed from the error:

Error sending "EXE": Error1. <servername> : The term '<servername>' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:240 + ... 0x[...]

What do you suggest?

Created on Apr 20, 2020 11:04:59 PM



Votes:

0

Hi, is it possible to disable the buttons? or at least they don't take any action. I do not want my users to execute any action, it is only informative

Thanks

Created on Sep 25, 2020 8:52:27 PM



Votes:

0

Hi there,

Please note that these are only example picture how the notification may look like. You can adjust the notification in the notification template as you want.

Created on Sep 28, 2020 4:57:53 PM by  Moritz Heller [Paessler Support]



Votes:

0

Hi All, I am using Prtg version 21.4.73.1656+ I am configured the sensor alerts notification with MS teams through webhook Kindly if anyone knows how to configure the Prtg notification end part on MS team like, scan now acknowledge, Pause or resume.

Created on Mar 28, 2022 8:29:18 AM



Votes:

0

I created a post today, awaiting moderation, with link to PowerShell script and allows full customisation. Not my work, just curated a little bit.

Created on Oct 13, 2022 1:00:03 AM




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.