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?
How do I create a webhook for the PRTG notifications to Slack and Microsoft Teams?
Votes:
1
12 Replies
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
- In your Slack app, go to the settings page and follow the instructions from the Slack API documentation: Sending messages using incoming webhooks.
- 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:
How to create a webhook for Microsoft Teams
- Open Microsoft Teams, go to the Workflows app and click on the Create tab.
- 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.
- Set up and add your workflow. For more information, see Microsoft Support: Post a workflow when a webhook request is received in Microsoft Teams.
- 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:
More
- PRTG Manual: Notification Templates, sections Send Microsoft Teams Message and Send Slack Message
- PRTG Manual: Notifications
- More custom notifications at PRTG Sensor Hub
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.
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.
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
Votes:
2
Hi there,
Thanks a lot for sharing this. We appreciate your work.
Kind regards,
Birk Guttmann, Tech Support Team
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!
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.
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?
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
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.
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.
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.
Add comment