version 7.1.0.28+

Setting up the Slack Integration project

You can configure the Netcool/Impact Slack Integration project to work with Slack.

Note: The Slack Integration project in only available in Fix Pack 28 or higher.

High-level description

In this Slack project, when an event occurs, the Slack event reader receives the event from ObjectServer and triggers the Slack policies to run, The policies create the Slack channel, invite users to the channel, post events to channel, and send the user response buttons to the channel.

Users can choose to respond to an event by clicking one of the response buttons, the event will be reloaded. Users can also click on the event to view its details. This launches the Event Viewer for the event.

The Slack project described in this section is an example. You can use the code in the policies to further develop your own Slack customization.

Note: The ObjectServer and probe configurations described in this section are optional. For an example of the sending a simple message to Slack, see the following Slack API page: Sending messages.

Configuring the integration project for Slack

Use the following steps to configure the integration project for Slack:

Configure the Slack workspace

Refer to your Slack documentation for details about how to create a Slack workspace, how to configure a Slack workspace if one already exists, customization, configuration and API usage.

Configure the RESTful API Data Source to send event data to Slack

This step is required.

  1. On the Impact GUI, select the project Slack.

  2. Open the Data Model tab and the Slack datasource.

  3. Change the Authorization header to your own Slack Bot User OAuth token.

    You can obtain the Slack Bot User OAuth Token from https://api.slack.com/apps/ by navigating to Slack App workspace -> OAuth & Permissions -> OAuth Tokens for Your Workspace -> Bot User OAuth Token.

  4. Create an ObjectServer datasource or use an existing one.

    Note: The default Event Mapping table has the restriction filter "Slack=1". The Slack event reader name is specified by slackeventreader in the NCI_slackeventreader.props file.
  5. Install the Slack certificate for SSL communications between Impact and Slack.

    1. Export the Slack certificate using the following sample command:

      echo -n | openssl s_client -connect slack.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/slack.cert
    2. Import the certificate to the Impact truststore using the following command:

      {$IMPACT_HOME)/sdk/bin/keytool -importcert -alias Slack -file /tmp/slack.cert -keystore {$IMPACT_HOME)/wlp/usr/servers/NCI/resources/security/trust.jks -storepass {$password}
    3. For information about Impact on OCP, see Enabling SSL communications from Netcool/Impact on Red Hat OpenShift.

Configure the Netcool/OMNIbus Event Reader Service for Slack events

This step is only required if you are using the Event Reader, ObjectServer or probe to forward events from Netcool/OMNIbus.

  1. On the Impact GUI, select the project Slack.

  2. Open the Service tab and the slackeventreader.

  3. Change the Data Source Name to that of your ObjectServer datasource.

  4. Select the Omnibus Event Reader fields to be returned from the ObjectServer.

    Note: A default set of the fields are preselected. Do not remove the Slack field from the list of columns.

Update the Impact Slack policies

This step is required.

  1. On the Impact GUI, select the project Slack.

  2. Open the Policies tab.

    You will see the following policies:

    • Slack_ProcessEvent.js

    • Slack_Functions.js

    • Slack_Utils.js

    • Slack_Config.js

  3. Open the policy Slack_Config for editing.

  4. Change the SlackTokenChannel variable to your Slack OAuth Token.

    Where the Slack OAuth Token is the Slack App workspace token, and

    You can obtain the Slack OAuth Token from https://api.slack.com/apps/ by navigating to Slack App workspace -> OAuth & Permissions -> OAuth Tokens for Your Workspace -> User OAuth Token

  5. Change the UserIDs variable to the user IDs you want to invite to channels.

    Where UserIDs is the user ID to invite to the channel. It can be obtained by accessing the View all members of this channel icon on the top corner of a channel, and click on the member, and select Copy member ID.

  6. Change the dashboardURL variable to your dashboard hostname and port.

    Where dashboardURL is the DASH hostname and port.

    Note: The Channel Name on Slack can be customized, see Customize the setup.
    Note: The noiView variable is the View parameter, having a value of default, which forms part of the URL.

Set up the ObjectServer database

This step is only required if you are using events in the ObjectServer.

  1. Copy <impact_install_directory>/add-ons/slackintegration/db/slack_objectserver_fields_update.sql to your ObjectServer and run it.

    Running this SQL file adds the following fields to the alerts.status table in the ObjectServer:

    • Slack

      SlackChannel

      SlackChannelID

    Where:

    Slack is the event restriction filter field, which is configured in the slackeventreader.

    SlackChannel is the name of the Slack channel, see Customize the setup for the default channel name.

    SlackChannelID is the ID of the Slack channel, which is generated by Slack.

  2. Add the Send to Slack action in the right-click menus on the event list.

    For for details about adding the right-click menus in event lists, see Creating event management tools.

    Note: Clicking the Send to Slack action sets the Slack field in the alerts.status table to the value of 1.

Set up the Netcool/OMNIbus Probe for Message Bus files

This step is only required if you are using the ObjectServer or the probe.

  1. Install the Probe for Message Bus on the ObjectServer.

  2. Copy the <impact_install_directory>/add-ons/slackintegration/probe/message_bus_slack.props file to the <omnibus_install_directory>/omnibus/probes/linux2x86 directory

  3. Rename the message_bus_slack.props file to message_bus.props

  4. Copy the <impact_install_directory>/add-ons/slackintegration/probe/message_bus_slack.rules file to the <omnibus_install_directory>/omnibus/probes/linux2x86 directory.

  5. Copy the <impact_install_directory>/add-ons/slackintegration/probe/httpTransport_slack.properties to the <omnibus_install_directory>/omnibus/java/conf directory.

    Where:

    <impact_install_directory> is the directory where Impact is installed.

    <omnibus_install_directory> is the directory where OMNIbus is installed.

  6. Start the probe.

    For details about how to run the probe after completing file setup, see Running probes

Customize the setup

After you have completed the setup steps, you can customize the default settings.

  1. Customize the Channel Name.

    The default channel name uses the following format:

    ChannelName = "Impact_" + EventContainer.Node + EventContainer.Serial

    You can modify this in the getEventDetails function in NCI_Slack_Utils.js during the creation of the channel.

  2. Customize the events sent to Slack

    The default event sent to Slack is the affected event Serial on the Dashboard Event Viewer.

    You can modify this in the postEventToChannel function in NCI_Slack_Utils.js.

    The color and the text of the event sent to Slack is handled in the translateSeverity function in NCI_Slack_Utils.js, and can be customized. More event data can also be added by modifying this function.

  3. Customize the channel event user buttons.

    The possible default user response buttons are:

    • Acknowledge

    • Resolve

    • Escalate

    • Reload event

    You can modify this in the postEventToChannel function in NCI_Slack_Utils.js. Or you can add more response buttons.

    Note: You will also have to change the Netcool/OMNIbus message_bus_slack.rules file accordingly.