While they might be useful for some, we'd like to remove the buttons that present with alarms in our Slack integration. We've opted to Define custom content in our Notification template, and removed many of the placeholders to streamline our received messages.

Specifically, the buttons are: Scan Now Acknowledge Alarm Pause Pause for 60 minutes Resume


Article Comments

Hello there,

The built-in Slack notification cannot be edited, however, you can create alternatively an Execute HTTP Action notification:

  1. Add the url of your Slack webhook
  2. Set HTTP Method to POST
  3. For "Payload" you can use something like this then for example: payload={ "text": "%device %status %down (%message)...", "link_names": 1, "attachments": [ { "title": "Sensor: %device %name", "title_link": "%homesensor.htm?id=%sensorid", "text": "*Status:* %status %down \n*Date/Time:* %datetime \n*Last Result:* %lastvalue \n*Last Message:* %message \n*Probe:* %probe \n*Group:* %group \n*Device:* %device () \n*Last Scan:* %lastcheck \n*Last Up:* %lastup \n*Last Down:* %lastdown \n*Uptime:* %uptime \n*Downtime:* %downtime \n*Cumulated since:* %cumsince \n*Location:* %location", "color": "%colorofstate", "mrkdwn_in": ["text", "pretext"] } ] }

Here you can find all PRTG placeholders if you like to adjust the content further.

Kind regards,

Erhard


Nov, 2018 - Permalink

This has worked exactly as we wanted. Thanks for the support.


Nov, 2018 - Permalink

Hi - currently just tried to set this up and not receiving anything in Slack? Has the required config changed in later updates?

-Dave


Jun, 2022 - Permalink

Hi Dave,

Thank you for your message.

The API of Slack might have indeed changed since the creation of this post and therefore the payload and URL might need to be adapted.

According to the documentation of Slack, the data is expected in JSON format and therefore it is also necessary to use a custom script (ex: PowerShell) with the Execute Program action within the notification template (Execute HTTP action doesn't support JSON/XML).

To do so, you need to copy the script under "C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE" on the PRTG server.

Here is the documentation from Slack for further information: https://api.slack.com/messaging/webhooks

Regards.


Jun, 2022 - Permalink