Configuration of Slack with cnMaestro Webhooks

Slack is a platform for team communication, offering instant messaging, document sharing, and knowledge search.

Following is a simple example of configuring Slack integration with cnMaestro Webhooks using a custom Template.

  1. On your Slack Screen, click on your workspace name at the top of the left-hand menu and open Administration > Manage apps. 

  1. In the apps screen, click on the Build and then on the Start Building button.

  1. In the Create Slack App screen, enter an app name of your choice and select your Slack Workspace in the dropdown. Click Create App.

fig4.PNG

  1. In the Basic Information screen, select “Incoming Webhooks” from the left menu and create a webhook, providing all the permission and targeted Slack Channel details.

  1. From the above screen copy the Webhook URL, this needs to be used as URL in cnMaestro Webhook in the next steps.
  1. Login to cnMaestro and Navigate to Application >Settings >Webhooks.
  1. Click Add Webhook. Paste the URL from Slack and Expand Advanced Configuration.

Slack expects a custom JSON payload, The simple one is as follows

{

“text” : "<message>"

}

For this example, we are using the following custom template with variables $DEVICE_IP and $ALARM_SEVERITY in the formatted message.

{

"text" : "$DEVICE_IP has generated an alarm of severity

$ALARM_SEVERITY”

}

  1. Once an alarm occurs, the following message will appear in the configured Slack channel. Notice the variables have been replaced with actual values.

fig7.PNG

Learn more about Slack Webhook and expected JSON format at https://api.slack.com/incoming-webhooks .

10 Likes