Sending data to a Slack channel

This document demonstrates how to send data to a Slack channel, using Nexthink webhook capability, to stand out from other messages in the channel.

In Slack

  1. Create a new Slack app in the workspace where you want to post messages.

  2. From the Features page, toggle Activate Incoming Webhooks on.

Activating incoming webhooks in Slack
  1. Click Add New Webhook to Workspace.

Adding new webhook to workspace
  1. Pick a channel that the app will post to, then click Authorize.

Authorization
  1. Copy the generated Incoming Webhook URL for future reference. That is, for the connector credential and webhook configuration in the Nexthink web interface. Webhook URL example: https://hooks.slack.com/services/T00000000/BXXXXXXXXXX/PLVXXXXXXXXXXXXXXXXXXXXX

Webhook URL

In Nexthink

From the Nexthink web interface:

Configuring a connector credential for Slack

From the connector credential configuration page, fill out the fields using the information from the connection you created in Slack.

  1. Choose the HTTPS option from the Protocol drop-down.

  2. Paste the root https://hooks.slack.com/ into the URL address field from Webhook URL from Slack configuration.

  3. Choose Basic option from the Authorization drop-down.

  4. Type in Test in the fields Username and Password, as these fields are not required when configuring Incoming Webhooks for Slack.

  5. Save the credential.

Configuring a webhook for Slack channel

From the webhook configuration page, fill out the fields using the information from the connection you created in Slack and the connector credential defined in Nexthink:

  1. Fill in the NQL Condition following the Configuring webhook NQL conditions documentation.

    alert.alerts
    | where monitor.tags contains "web-applications"
    | where alert.context contains "*Salesforce*" or alert.context contains "*Microsoft*"
    | list alert.monitor.name, alert.status, monitor.tags, alert.context, trigger_time, recovery_time, alert.monitor.thresholds, monitor.priority, alert.trigger_values, alert.trigger_reference_value, alert.recovery_values, alert.context, device_view_link, issue_view_link, device.name
  2. Choose the configured connector credential for Slack from the Credentials drop-down.

  3. Select the POST from the Method drop-down.

  4. Paste into the Resources field, the URL endpoint from the Slack configuration without the root URL address. For example: services/T00000000/BXXXXXXXXXX/PLVXXXXXXXXXXXXXXXXXXXXX

  5. Add the message you want to send in Payload. See the example below. alert.alerts

    {
      "text": "There is an alert {{alert.monitor.name}} that is affecting the digital experience"
    }
  6. Send Test to make sure the message is pushed into Slack.

Refer to the Slack API documentation for more information about supported payloads.

Last updated

Was this helpful?

#451: 2024.8-Overview of integration DOC

Change request updated