---
title: "How to integrate OP5 Monitor with Slack"
description: "Integrate OP5 Monitor with Slack to send alerts directly to your team's Slack channel. Configure the Slack plugin, create check commands, and assign a Slack contact to hosts or services."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020056214-op5-monitor-how-to-integrate-op5-monitor-with-slack/index.html"
---
notify\_slack.py tested and worked on OP5 Monitor version 9 using Python version 2.

## Support information

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!](https://www.itrsgroup.com/about/contact)

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.

## Screenshots

![OP5 Monitor - How to integrate OP5 Monitor with Slack](https://docscdn.itrsgroup.com/faq/images/op5/360020056214-18317692-OP5_mon_slack.png)

## In Slack

1. Go to <https://api.slack.com/apps?new_app=1>
2. Create a *Incoming WebHook* and tie it to your teams channel, like for example #devops

   ![OP5 Monitor - How to integrate OP5 Monitor with Slack](https://docscdn.itrsgroup.com/faq/images/op5/360020056214-18317692-create_webhook_nyhet.png)

3. Make a note of the Webhook URL, this is your token we will be using later:

   ![OP5 Monitor - How to integrate OP5 Monitor with Slack](https://docscdn.itrsgroup.com/faq/images/op5/360020056214-18317692-slack_webhook_url_token.png)

## In OP5 Monitor

To tie Slack to OP5 Monitor, we will need to configure the following:

1. Upload the Slack plugin onto your OP5 Monitor server;
2. Create check commands 'host-notify-slack' and 'service-notify-slack';
3. Create a Slack contact.

### Uploading the Slack plugin onto your OP5 server

Upload the plugin  **[notify\_slack.py](/faq/downloads/op5/360020056214-6228660303645-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 755, 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.

1. From the **Manage** menu select **Configuration** and click on **Commands**
2. Configure two check commands, one named host-notify-slack and service-notify-slack with the settings as described below**:**

```
host-notify-slack
       command_name: host-notify-slack
       command_line: $USER1$/custom/notify_slack.py -c "$ARG1$" -t "$ARG2$" -X "$ARG3$" -H "$HOSTNAME$" -L "$HOSTSTATE$" -m "$HOSTOUTPUT$" -U "OP5 Monitor"

service-notify-slack
       command_name: service-notify-slack
       command_line: $USER1$/custom/notify_slack.py -c "$ARG1$" -t "$ARG2$" -X "$ARG3$" -H "$HOSTNAME$" -L "$SERVICESTATE$" -S "$SERVICEDESC$" -m "$SERVICEOUTPUT$" -U "OP5 Monitor"
```

![OP5 Monitor - How to integrate OP5 Monitor with Slack](https://docscdn.itrsgroup.com/faq/images/op5/360020056214-18317692-check_commands_nyhet.png)

### Create a Slack contact

1. From the **Manage** menu select **Configuration** and click on **Contacts**
2. Create a new contact, give it a name like for example: Slack
3. Set host\_notification\_cmds, host\_notification\_cmds\_args and service\_notification\_cmds, service\_notification\_cmds\_args as described below:

```
host_notification_cmds: host-notify-slack
host_notification_cmds_args: "<#channel>"!"<token/webhook_url>"!"https://url-to-op5"

service_notification_cmds: service-notify-slack
service_notification_cmds_args: "<#channel>"!"<token/webhook_url>"!"https://url-to-op5"

Here's an example from our OP5 Monitor environment:
host_notification_cmds: host-notify-slack
host_notification_cmds_args: "#devops"!"https://hooks.slack.com/services/TXXXX/B2XXXX/EflrMrZTNlOKEbXXXXXXR"!"https://demo.op5.com"

service_notification_cmds: service-notify-slack
service_notification_cmds_args: "#devops"!"https://hooks.slack.com/services/TXXXX/B2XXXX/EflrMrZTNlOKEbXXXXXXR"!"https://demo.op5.com"
```

## **That's it!**

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.


