mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Pretty up Slack formatting. (#15898)
* Pretty up Slack formatting. * Normalize spaces by turning every instance of two or more spaces into one space. * Allow for custom URL links even when strip_tags() is in effect by transformaing "standard" markdown syntax into Slack link markdown after strip_tags() is run. * Document the changes to the Slack transport. While here, flesh out the Slack docs to match the configuration options one currently sees in the transport. * Use backticks to escape things from markdown rendering. * We don't need this other escaping now. * Fix custom link due to line break. * Fix spelling typo. --------- Co-authored-by: Joe Clarke <jclarke@cisco.com>
This commit is contained in:
@@ -774,16 +774,36 @@ only required value is for url, without this then no call to Slack will be made
|
||||
|
||||
We currently support the following attachment options:
|
||||
|
||||
`author_name`
|
||||
- `author_name`
|
||||
|
||||
We currently support the following global message options:
|
||||
|
||||
- `channel_name` : Slack channel name (without the leading '#') to which the alert will go
|
||||
- `icon_emoji` : Emoji name in colon format to use as the author icon
|
||||
|
||||
[Slack docs](https://api.slack.com/docs/message-attachments)
|
||||
|
||||
The alert template can make use of
|
||||
[Slack markdown](https://api.slack.com/reference/surfaces/formatting#basic-formatting).
|
||||
In the Slack markdown dialect, custom links are denoted with HTML angled
|
||||
brackets, but LibreNMS strips these out. To support embedding custom links in alerts,
|
||||
use the bracket/parentheses markdown syntax for links. For example if you would
|
||||
typically use this for a Slack link:
|
||||
|
||||
`<https://www.example.com|My Link>`
|
||||
|
||||
Use this in your alert template:
|
||||
|
||||
`[My Link](https://www.example.com)`
|
||||
|
||||
**Example:**
|
||||
|
||||
| Config | Example |
|
||||
| ------ | ------- |
|
||||
| Webhook URL | <https://slack.com/url/somehook> |
|
||||
| Slack Options | author_name=Me |
|
||||
| Channel | network-alerts |
|
||||
| Author Name | LibreNMS Bot |
|
||||
| Icon | `:scream:` |
|
||||
|
||||
## SMSEagle
|
||||
|
||||
|
Reference in New Issue
Block a user