This article was written for version 7.2.9 of OP5 Monitor. It could work on both lower and higher version if nothing else is stated. The Slack integration and its dependencies are third-party add-ons. These are not officially supported by OP5 AB. If you need a supported integration between OP5 Monitor and Slack, please contact us!
By integrating Slack into your existing OP5 monitoring solution, you can have OP5 alerts sent directly to your teams Slack channel. See the screenshot below for the end result.
- Go to https://api.slack.com/apps?new_app=1
- Create a Incoming WebHook and tie it to your teams channel, like for example #devops
- Make a note of the Webhook URL, this is your token we will be using later:
In OP5 Monitor
To tie Slack to OP5 Monitor, we will need to configure the following:
- Upload the Slack plugin onto your OP5 Monitor server;
- Create check commands 'host-notify-slack' and 'service-notify-slack';
- Create a Slack contact.
Uploading the Slack plugin onto your OP5 server
Upload the plugin notify_slack.py attached in this article to your OP5 server(s) into the directory: /opt/plugins/custom/
Change the permissions on the notify_slack.py file to 744, by issuing the command: chmod 744 /opt/plugins/custom/notify_slack.py
Create check commands (host-notify-slack and service-notify-slack)
The slack integration is tied to check commands, that is later tied to your Slack contact we will be creating in the last step.
- From the Manage menu select Configuration and click on Commands
- Configure two check commands, one named host-notify-slack and service-notify-slack with the settings as described below:
Create a Slack contact
- From the Manage menu select Configuration and click on Contacts
- Create a new contact, give it a name like for example: Slack
- Set host_notification_cmds, host_notification_cmds_args and service_notification_cmds, service_notification_cmds_args as described below:
Finally, in order for OP5 Monitor to forward alerts to Slack you must assign the "Slack" contact you created earlier as a contact to a host or specific services.