Mattermost Notifications

If your organization uses Mattermost, you can configure Horizon to send notices to any channel via an incoming webhook. You must configure an incoming webhook in your Mattermost settings and manually configure some settings in your Horizon instance.

For more information on incoming webhooks in Mattermost, see the Mattermost Integration Guide.

Setup

First, add the following XML to notificationCommands.xml (no customization should be needed):

<command binary="false">
  <name>mattermost</name>
  <execute>org.opennms.netmgt.notifd.MattermostNotificationStrategy</execute>
  <comment>class for sending messages to a Mattermost team channel for notifications</comment>
  <argument streamed="false">
    <switch>-subject</switch>
  </argument>
  <argument streamed="false">
    <switch>-tm</switch>
  </argument>
</command>

Create mattermost.properties in your opennms.properties.d directory, and insert the following property:

org.opennms.netmgt.notifd.mattermost.webhookURL=https://mattermost.example.com/hooks/bf980352b5f7232efe721dbf0626bee1

Customize its values as appropriate for your organization.

Horizon loads mattermost.properties upon restart. After it is loaded, your new mattermost notification command will be available for use in a destination path.

Additional configuration options

The following table lists optional properties that you may use in mattermost.properties to customize your Mattermost notifications:

Parameter Description Default Value Example

org.opennms.netmgt.notifd.mattermost.channel

Specify a channel or private group other than the one targeted by the webhook.

Webhook default

NetOps

org.opennms.netmgt.notifd.mattermost.username

The username to associate with the notification posts.

Blank

OpenNMS_Bot

org.opennms.netmgt.notifd.mattermost.iconEmoji

An emoji sequence to use as the icon for the notification posts.

Blank

:metal:

org.opennms.netmgt.notifd.mattermost.iconURL

The URL of an image to use as the icon for the notification posts.

Blank

https://example.org/assets/icon.png

org.opennms.netmgt.notifd.mattermost.useSystemProxy

Should the system-wide proxy settings be used? Configure the system proxy settings via system properties.

true

true

Some of the optional configuration parameters are not compatible with some versions of Mattermost.