[icinga-notifications] - webhook Mattermost

Hello,

Has anyone managed to set up a proper body template for sending a simple notification in Mattermost?

A

I’ve tried every possible option, but nothing works

Thanks !

Hi @valderaplets,

Icinga Notifications uses the go templating syntax for the Request Body Template.
An example of how this looks like can be found here. Maybe you can adapt this to your specific needs with mattermost.

Hope this helps with your issue

Best regards

Christoph

Thx !

Thanks! I found the plugins on go.dev. It is indeed a bit clearer, but here’s an example for anyone else looking :


{ "text": "{{if eq .Incident.Severity.String "crit"}}🔥 **Critical**{{else}}{{if eq .Incident.Severity.String "warning"}}⚠️ **Warning**{{else}}{{if eq .Incident.Severity.String "ok"}}✅ **OK**{{else}}ℹ️{{end}}{{end}}{{end}}\n\n:computer: **{{.Object.Tags.host}}**\n\n:robot_face: **{{.Object.Tags.service}}**\n\n:clock1: **{{.Event.Time.Format "2006-01-02 15:04:05"}}**\n{{if ne .Incident.Severity.String "ok"}}\n```\n{{.Event.Message}}\n```\n{{end}}\n\n:link: [See Icinga Web]({{.Object.Url}})"}