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

Customized JSON webhook notifications to Discord (Teams, Slack, others)

Votes:

0

As of this writing, PRTG only has native support for Notification webhooks with Slack and MS Teams. Also, the HTTP POST feature for notifications does not support JSON and XML.

Therefore, deploying a webhook to Discord requires an powershell script and is easy to deploy. This post is to create a pointer to the awesome work by mmetully, and I take no credit for this.

https://github.com/mmetully/prtg-notifications-discord

I am wondering why Paessler have not added this support natively as is really very simple.

Out of the box there is one issue with the script, related to lack of TLS support and is easily addressed by adding the following line to the code, as noted here: https://github.com/mmetully/prtg-notifications-discord/issues/

[Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"

I do suggest that before jumping directly to the PRTG configuration, you test the script from a Powershell CLI and confirm operation. Once confirmed, you can then create the PRTG Notification template.

I took one more step and commented the variable $uri on line 73 and send it in the parameters instead.

-sensor '%sensor' -sensorID '%sensorid' -status '%status' -message '%message' -since '%since' -lastup '%lastup' -device '%device' -sensorURL '%linksensor' -deviceURL '%linkdevice' -serviceURL '%serviceurl' -uri 'https://discord.com/api/webhooks/your_webhook_uri_here'

The solves the problem of ability to have multiple PRTG Notification Templates, in order to send messages to different Discord Server channels. e.g. one channel per site that you monitor in PRTG.

The other issue is the Acknowledge link goes to the serviceURL, but can be easily addressed if needed.

I hope others find this information useful.

discord prtg webhook

Created on Oct 12, 2022 4:52:49 PM

Last change on Oct 14, 2022 5:58:18 AM by  Felix Wiesneth [Paessler Support]



2 Replies

Votes:

0

Also, I neglected to mention that this method addresses the need for custom JSON based webhook to any target platform, e.g. Teams, Slack, others. I may update the title to reflect this.

Created on Oct 13, 2022 6:18:30 PM



Votes:

0

I forked the github to build in the fixes as well as some additional enhancements like graphical logos. I have not re-written the top section, to streamline the comments as of this writing.

https://github.com/JJWatMyself/prtg-notifications-discord

Here is the screen snip of the notifications with PRTG status logos added: https://github.com/JJWatMyself/prtg-notifications-discord/blob/master/example_alerts.png

Created on Dec 12, 2022 11:34:43 PM




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.