Git Product home page Git Product logo

munin-mattermost's Introduction

Munin Mattermost Notify

Simple script to post Munin alerts to a Mattermost channel.

Munin Mattermost Notify

A working Mattermost server as well as a working Munin instance is required - Just sayin' ¯\_(ツ)_/¯

Installation

  1. Simply clone the git repo or download as a zip file.
    git clone https://github.com/bjoernr-de/munin-mattermost.git /tmp/munin-mattermost
  2. 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/
  3. Follow the Mattermost configuration section below.
  4. Edit the /etc/munin/munin_mattermost_notify.sh file with your preferred editor and modify the variables section to your setup
  5. Make it executable
    chmod +x /etc/munin/munin_mattermost_notify.sh
  6. Finally follow the Munin configration steps below.

Mattermost configration

  1. 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.
  2. 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.
  3. 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

Munin configuration

  1. Edit the /etc/munin/munin.conf file with your preferred editor.
  2. Copy & Paste the munin configuration from inside the comments in munin_mattermost_notify.sh into munin.conf
  3. 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
  4. Make sure that contacts.mattermost.text is a one-liner and you have copied the whole line.
  5. Restart munin

munin-mattermost's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

munin-mattermost's Issues

Pre-Requirements

  • Add curl to list of pre-requirements
  • Check if curl is installed in script

Unable to parse [ERROR]

Hello there,

So first issue on your repo.
Thank you for your scrip which i think can be really helpfull.
I follow your guide and made a test with a df test to send an alerts.

I never been able to have it working fine.
I got an error on the mattermost side
CET] [EROR] /hooks/to8199i3kidk5eerp1w8jgz1ey:IncomingWebhookRequestFromJson code=400 rid=irkdfujsatfatfirhshx9gcydr uid= ip=... Unable to parse incoming data [details: invalid character '\' after object key:value pair]

There is the command line which is sent by munin:
`
curl -s -o /dev/null -X POST -d 'payload={"channel":"Alerts", "username":"Munin Alert", "icon_url":"https://munin.tata.it/funny_crow.jpg", "text":"##### doc.tata.it - disk Disk usage in percent

Category Value
Group VMserver
Host doc.tata.it
Munin graph category disk
Level ❔ UNKNOWN
Alert name Disk usage in percent

"\u000A* WARNINGs\u000A * / is 64.45 "

https://munin.tata.it
https://munin.tata.tiVMserver/doc.tata.it#disk"}' https://chat.tata.it/hooks/to8199i3kidk5eerp1w8jgz1ey
`
What do you think ? How could i help?

Thanks
Zwordi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.