To configure a single Slack channel to receive notifications for multiple webhook data types, you'll need to customize the payload that is sent to Slack's Incoming Webhook URL.
Since you've already created a new template, you'll need to edit the JSON payload in the "Edit" field to include the information for the different webhook data types you want to receive notifications for.
To configure your webhook to send notifications to Slack with the data types you need, you’ll want to structure your JSON payload to include the relevant information for each event type. Here’s an example of how you might set up a JSON payload for different event types:
JSON
{
"text": "Network Alert",
"attachments": [
{
"fallback": "Required plain-text summary of the attachment.",
"color": "#36a64f",
"pretext": "Pretext message to introduce the alert",
"author_name": "Network Monitoring System",
"title": "Event Type: AP came up",
"text": "Details about the event, such as location and time",
"footer": "Network Operations Center",
"footer_icon": "https://path_to_your_logo.png",
"ts": 123456789
}
]
}
In this payload:
"text" is the main message text that will be displayed in the Slack channel.
"attachments" is an array of structured messages that can include more detailed information.
"fallback" is a plain-text summary of the attachment.
"color" is a hex color code that will be used as a strip along the left side of the message attachment.
"pretext" is optional text that appears above the attachment block.
"author_name" is the name of the author or system sending the alert.
"title" specifies the event type.
"text" provides additional details about the event.
"footer" and "footer_icon" allow you to add a small footer with an icon.
"ts" is an optional Unix timestamp that Slack will convert into a time.
You can create multiple attachments within the "attachments" array for different event types, and each attachment can have its own color and details.
To handle multiple event types like 'AP came up', 'AP went down', 'cable error', 'power supply went down', etc., you can set up multiple attachments within the same payload, each with its own `title` and `text` reflecting the specific event.
If you want to include dynamic data from the webhook, you can use placeholders in your template that will be replaced with actual data when the webhook is triggered.
For the exact fields and formatting options available in Slack messages, refer to the [Slack message formatting documentation].
Sending messages using Incoming Webhooks | Slack
I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.
Please, if this post was useful, leave your kudos and mark it as solved.