You can download the latest plugin binary release and upload it to your server via System Console > Plugin Management.
- In Mattermost, go to System Console > Plugins > Nagios.
- Set the Nagios URL. Remember to add
http://
orhttps://
at the beginning (e.g.:https://nagios.fedoraproject.org
). - Set Nagios Username to the Nagios user used to authentiacte.
- Sett Nagios Password to the password of that user.
- Select Save.
- Go to Plugins > Nagios, then select **Enable.
- The plugin is now ready to use.
This step is optional, although highly recommended.
Regenerate the token for the configuration files watcher:
- In Mattermost, go to System Console > Plugins > Nagios.
- Select Regenerate to regenerate the token.
- Copy the token - you're going to use it later.
- Select Save.
- Switch to the machine where Nagios is running:
- Download the latest stable version of the watcher from the releases page
- Move the watcher:
chmod +x watcher1.1.0.linux-amd64 && sudo mv watcher1.1.0.linux-amd64 /usr/local/bin/watcher
.
Prepare the systemd service unit file by adjusting dir
(default if not set: /usr/local/nagios/etc/
), url
, and token
flags to your setup.
sudo bash -c 'cat << EOF > /etc/systemd/system/mattermost-plugin-nagios-watcher.service
[Unit]
Description=Nagios configuration files monitoring service
After=network.target
[Service]
Restart=on-failure
ExecStart=/usr/local/bin/watcher -dir /nagios/configuration/files/directory -url https://mattermost.server.address/plugins/nagios -token TheTokenFromStep1
[Install]
WantedBy=multi-user.target
EOF'
systemctl daemon-reload
systemctl enable mattermost-plugin-nagios-watcher.service
systemctl start mattermost-plugin-nagios-watcher.service
Ultimately, this will make you or your team more productive and make the experience with Nagios smoother.
When you’ve tested the plugin and confirmed it’s working, notify your team so they can connect their Nagios account to Mattermost and get started. Copy and paste the text below, edit it to suit your requirements, and send it out.
Hi team,
We've set up the Mattermost Nagios plugin, so you can get notifications from Nagios in Mattermost. To get started, take a look at the slash commands section (link).