Simple script to post Munin alerts to a Mattermost channel.
A working Mattermost server as well as a working Munin instance is required - Just sayin' ¯\_(ツ)_/¯
- Simply clone the git repo or download as a zip file.
git clone https://github.com/bjoernr-de/munin-mattermost.git /tmp/munin-mattermost
- Move the script to a place of your choice. We use /etc/munin/ in this example.
mv /tmp/munin-mattermost/munin_mattermost_notify.sh /etc/munin/
- Follow the Mattermost configuration section below.
- Edit the
/etc/munin/munin_mattermost_notify.sh
file with your preferred editor and modify the variables section to your setup - Make it executable
chmod +x /etc/munin/munin_mattermost_notify.sh
- Finally follow the Munin configration steps below.
- You need to have Incoming Webhooks enabled on your Mattermost server.
Check Custom Integration in your System Console.
Optionally you can activate Enable integrations to override usernames and Enable integrations to override profile picture icons as well. - Create an Incoming Webhook in your Mattermost server using the Integrations page accessible through the menu.
Choose a Display Name*, Description* as well as the Channel in which the notifications should appear. - Copy the webhook URL and proceed with installation step 4
* Display name and description can be overwritten by the script if you have activated the features in step 1
- Edit the
/etc/munin/munin.conf
file with your preferred editor. - Copy & Paste the munin configuration from inside the comments in
munin_mattermost_notify.sh
intomunin.conf
- If you have used another path than the one in installation step 2 for the script, you need to adjust the path in
contact.mattermost.command
- Make sure that
contacts.mattermost.text
is a one-liner and you have copied the whole line. - Restart munin