A plugin for Nagios and compatible software (e.g. Icinga) to enable notifications to a Mattermost server.
Run ./mattermost.py --help for full usage information.
-
Incoming Webhooks must be enabled for your Mattermost server. Check the Enable Incoming Webhooks option under Service Settings in the System Console.
-
To use the optional
--usernameparameter you must enable overriding of usernames from webhooks. Check the Enable Overriding Usernames from Webhooks and Slash Commands option under Service Settings in the System Console. -
To use the optional
--iconurlparameter you must enable overriding of icons from webhooks. Check the Enable Overriding Icon from Webhooks and Slash Commands option under Service Settings in the System Console.
The steps below are for a Nagios 4 server but should work with minimal modifications for compatible software:
-
Copy
mattermost.pyto/usr/local/nagios/libexec. -
Create an Incoming Webhook integration for the approriate team and note the provided URL.
-
copy configuration
mattermost.cfgto/etc/nagios4/conf.d/and upgrade parameter <MATTERMOSTE_URL>, <MATTERMOSTE_CHANNEL> and <NAGIOS_CGIURL> -
Add the contact to a contact group in your Nagios configuration:
define contactgroup{
contactgroup_name network-admins
alias Network Administrators
members email, mattermost
}