Configuring Applications for the Slack SyncPack

Download this manual as a PDF file 

This section describes how to set up the PowerFlow applications for the "Slack" SyncPack.

Workflow for Configuring the SyncPack

The following workflows describe how to configure Slack, SL1, and PowerFlow to work with the "Slack" SyncPack.

Configuring Slack

  1. Create an app in Slack
  2. Enable Incoming Webhooks
  3. Add and Configure Bots
  4. Add Slash commands for your app
  5. Activate Interactivity for your app
  6. Install your app

Configuring SL1

  1. Create a credential for the action policies in the "Slack Integration" PowerPack
  2. Align the SL1 action policies

Configuring PowerFlow

  1. Create a PowerFlow configuration object
  2. Align the configuration object and configure PowerFlow applications

Configuring Slack

The following topics cover how to set up Slack to work with this SyncPack.

Create an app in Slack

  1. Go to https://api.slack.com/apps and click Create New App.
  2. The Create an app dialog appears.
  3. Select From scratch.
  4. The Name app & choose workspace dialog appears.
  5. Enter a name for the application in the App Name field.
  6. In the drop-down menu under Pick a workspace to develop your app in, select the appropriate workspace.
  7. Click the Create App button.
  8. The Basic Information page appears, with the new app available in the drop-down menu at the top left.

Enable Incoming Webhooks for your app

  1. On the Basic Information page, click Incoming Webhooks from the Add features and functionality section.
  2. Toggle on (green) Activate Incoming Webhooks.

You may need to first request permission to add a webhook from your Slack Administrator.

  1. Click the Add New Webhook to Workspace button under the Webhook URLs for Your Workspace section.
  2. Select the channel you want to receive messages to from the Where should <app_name> post? field.
  3. Click the Allow button.

Be sure to add the channel in Slack where you want to receive messages to, if you do not want messages to post to an existing channel. If you want to receive messages in multiple channels, you can add multiple webhook urls for different channels in your workspace.

Enable Bots for your app

  1. Click App Home from the Features menu on the left.
  2. Click the Edit button under Your App's Presence in Slack.
  3. On the Edit App Display Name dialog, edit the name of the bot in the Display Name (Bot Name) field, if needed.
  4. Edit the username of the bot in the Default username field, if needed.
  5. Click the Save button.
  6. Click OAuth & Permissions from the Features menu on the left.
  7. Configure the permissions that the bot has in your app:
    •  On the OAuth & Permissions page, click the Add an OAuth Scope button under Scopes and select one of the following scopes from the drop-down menu as needed:

      • channels:join. Join public channels in a workspace.
      • channels:manage. Manage public channels that your bot has been added to and create new ones.
      • channels:read. View basic information about public channels in a workspace.
      • chat:write. Send messages as @<bot_username>.
      • chat:write.public. Send messages to channels that @<bot_username> isn't a member of.
      • commands. Add shortcuts and/or slash commands that people can use.
      • groups:read. View basic information about private channels that your bot has been added to.
      • im:read. View basic information about direct messages that your bot has been added to.
      • incoming-webhook. Post messages to specific channels in Slack.
      • mpim:read. View basic information about group direct messages that your bot has been added to.
      • team:read. View the name, email domain, and icon for workspaces your bot is connected to.
      • users.profile:read. View profile details about people in a workspace.
      • users:read. View people in a workspace.

  1. Click the Request to Install button under OAuth Tokens for Your Workspace.

  2. In the window that appears, enter a message for your Slack administrator, if needed, and click the Submit Request button.

Your Slack administrator must approve this request in order to move forward. Once they do, be sure to save the Bot OAuth token, as you will need it when setting up your configuration object in PowerFlow later.

Add Slash commands for your app

  1. In PowerFlow, create an API key to use when adding Slash commands in Slack. For more information, section on Creating an API Key.
  2. Be sure to copy the API Key once it is generated, as you will need it to add Slash Commands for your app. After you close the modal in PowerFlow, you will only be able to see the first five characters of the key on the API Keys page.
  3. Click Slash Commands from the Features menu on the left. The Slash Commands page appears.
  4. Click the Create New Command button.
  5. Enter /service in the Command field.
  6. Enter https://<PowerFlowserver>/api/v1/applications/query_sl1_service_and_device_details/run?PF-APIKEY=<PF token> in the Request URL field.

In the URL above, replace <PF token> with the API Key you created in PowerFlow.

  1. Enter a short description of what the command does in the Short Description field.
  2. Enter any hint you want users to see when trying to enter the command in the Usage Hint field.
  3. Click the Save button.
  4. Repeat this process to add the /device command.

Activate Interactivity for your app

  1. Click Interactivity & Shortcuts from the Features menu on the left. The Interactivity & Shortcuts page appears.
  2. Toggle on (green) Interactivity.
  3. Enter https://<PowerFlowserver>/api/v1/applications/sync_sl1_event_status_from_slack/run?PF-APIKEY=<PF token> in the Request URL field.
  4. Click the Save Changes button.

Install your app

  1. Click OAuth & Permissions from the Features menu on the left. The OAuth & Permissions page appears.
  2. Confirm that your app has been approved and installed under OAuth Tokens for Your Workspace.

Configuring SL1

The following topics cover how to set up your SL1 instance to work with this SyncPack.

Creating a SOAP/XML Credential to Access SL1 PowerFlow

After you have integrated your Slack and SL1 PowerFlow systems, you must create a SOAP/XML credential so that the automation actions included in the "Slack Integration" PowerPack can access your SL1 PowerFlow system.

The "Slack Integration" PowerPack includes a sample SOAP/XML credential named "PowerFlow Slack" This credential lets you send event payload data from SL1 to PowerFlow and then to Slack. Use this credential to integrate with the Slack SyncPack by aligning this credential to the "Slack: Add/Update" run book action.

To define a SOAP/XML credential using the "PowerFlow Slack" credential:

  • Go to the Credentials page (Manage > Credentials).
  • Search for the "PowerFlow Slack" credential and click its name. The Edit Credential page appears.
  • Supply values in the following fields:
  • Name. Type a new name for the Slack credential.
  • Timeout (ms). Set to 5000.
  • Content Encoding. Select text/xml.
  • Method. Select POST.
  • HTTP Version. Select HTTP/1.1.
  • URL. Type the host name for PowerFlow.
  • HTTP Auth User. Type the username for your SL1PowerFlow user account.
  • HTTP Auth Password. Type the password for your SL1PowerFlow user account.
  • Click Save & Close to save the new SOAP/XML credential. SL1 adds the credential to the Credentials page and assigns the new credential an ID number.
  • On the Credentials page, make a note of the number in the ID column for the new credential. You will need this when editing the input parameters of the automation actions included in theSlack IntegrationPowerPack.

Aligning a Slack Credential to the Slack Automation Actions

After you have created a Slack credential, you must align the credential to the run book action policies included in this PowerPack. The aligned credential will work with the automation policy that is installed by default in this PowerPack to provide a working configuration.

The "Slack Integration" PowerPack includes six standard automation policies that you will need to enable. These policies update the SL1 events with the state of the associated event or alert, create a channel, or create channel notifications. When the event is first detected in SL1 or Slack, the "triggered" state is sent. When the event is acknowledged in SL1 or Slack, the "acknowledged" state is sent. When the event is cleared in SL1 or Slack, the "cleared" state is sent. When a channel is created, details are added to the SL1 event notes.

The following table shows the automation policy, its aligned events, and the automation action that runs in response to the events.

Automation Policy Name Aligned Events Automation Action
Slack: Create Channel

Major: Slack

Slack: Create Channel
Slack: Events - Acknowledge

All events

Slack: Acknowledge
Slack: Events - Add

Major: Slack

Slack: Add/Update
Slack: Event - Cleared

All events

Slack: Clear
Slack: Channel Notification - Acknowledge Slack: Channel Notification - Acknowledge
Slack: Channel Notification - Clear Slack: Channel Notification - Clear

 

To align the credential to the automation actions:

  1. Navigate to the Actions page (Registry > Run Book > Actions).
  2. Locate each of the Slack automation actions and click the wrench icon (). The Editing Action modal appears.
  3. In the Input Parameters field, change the values of the following parameter:
  • credential_id. Change the value to the credential ID that you noted earlier when creating a credential for your SL1PowerFlow system. This field is required.

Do not change the values of the other Input Parameters.

  1. Click Save.
  2. Repeat steps 2-4 for the remaining Slack action policies.

Configuring PowerFlow

The following topics cover how to set up your PowerFlow instance to work with this SyncPack.

Creating and Aligning a Configuration Object in PowerFlow

A configuration object supplies the login credentials and other required information needed to execute the steps for a PowerFlow application. The Configurations page () of the PowerFlow user interface lists all available configuration objects for that system.

You can create as many configuration objects as you need. A PowerFlow application can only use one configuration object at a time, but you can use (or "align") the same configuration object with multiple applications.

To use this SyncPack, you will need to use an existing configuration object in the PowerFlow user interface or create a new configuration object. Next, you need to align that configuration object to the relevant applications.

Creating a Configuration Object

For this SyncPack, you can make a copy of the "Sample Slack Config" configuration object, which is the sample configuration file that was installed with the Slack SyncPack.

The "Sample Slack Config" configuration object contains all of the required variables. Simply update the variables from that object to match your SL1 and Slack settings.

To create a configuration object based on the "Sample Slack Config" configuration object:

  1. In the PowerFlow user interface, go to the Configurations page ().
  2. Click the Actions button () for the "Sample Slack Config" configuration object and select Edit. The Configuration pane appears.
  3. Click Copy as. The Create Configuration pane appears.
  4. Complete the following fields:
  • Friendly Name. Name of the configuration object that will display on the Configurations page.
  • Description. A brief description of the configuration object.
  • Author. User or organization that created the configuration object.
  • Version. Version of the configuration object.
  1. In the Configuration Data field, update the default variable definitions to match your PowerFlow configuration:
  • sl1_host. The hostname or IP address of the SL1 system the alerts will synchronize to.
  • sl1_user. The username for your SL1 system.
  • sl1_password. The password for your SL1 system.
  • token. Bot user OAuth token from Slack.
  • default_ack_user. The default user to acknowledge events and alerts. This should be an SL1 user account, for example, /api/account/1.
  • slack_webhook_url. Incoming webhook URL configured in the Slack App. This can be found under the Webhook URLs for Your Workspace heading on the Incoming Webhooks page.
  • team_id. ID of the team to create the Slack channel in. This value is in the Slack webhook URL: https://hooks.slack.com/services/<team_id>/
  • users. Comma-separated Slack user IDs to invite to your created channel. The user Id should be formatted as "@<slack_username>".
  • region. The region value is a user-defined variable that identifies your SL1 instance within Slack.
  1. Click Save. You can now align this configuration object with one or more applications.

Aligning a Configuration Object and Configuring PowerFlow Applications

In PowerFlow, you will need to align the "Slack" SyncPack applications with your new configuration object in PowerFlow, and, if needed, update any other fields on the Configuration pane for the applications.

"Slack" SyncPack PowerFlow applications:

  • Create Slack channel For SL1 Event. This application creates a channel in Slack based on the event severity configured in SL1 and will post the event to the created channel.
  • Notify SL1 Event to new Slack Channel. This application creates a notification in a Slack channel from an SL1 event.
  • Notify SL1 Event to existing Slack Channel. This application sends a notification to Slack of a "Major" event in SL1
  • Query SL1 Service and Device details. This application allows you to query SL1 for service and device details from the Slack channel that ships with the SyncPack.
  • Sync SL1 Event status from Slack. This application synchronizes an event update made in Slack with the event status in SL1.

To align the configuration object with the relevant PowerFlow applications:

  1. On the Applications page of the PowerFlow user interface, search for Slack. Click on the name of one of the PowerFlow applications listed above to open the application.
  2. Click Configure. The Configurations pane for that application appears.
  1. From the Configurations drop-down, select the configuration object you want to use.

    The values for sl1_hostname and the other parameters that appear in the Configuration pane with a padlock icon () are populated by the configuration object you aligned with the application. Do not modify these values. If you encounter an error, make sure your configuration object is configured properly.

  1. Click Save to align that configuration with the application.
  2. Repeat this process for the other Slack applications in PowerFlow.

Using Slack to Trigger Commands and Respond to Event Messages

There are two direct ways to use the integration between SL1 and Slack. In Slack, you can use specific commands called "slash commands" to trigger certain actions to occur. You can also respond to an event notification in Slack, to be updated in SL1 by adding a note, acknowledging the event, or resolving it.

Triggering Slack Commands

You can use specific commands to request information from SL1 to display directly in Slack. To use the commands in Slack, type a slash (/) followed by the command, with no space between them.There are two primary command types configured to work with the integration between SL1 and Slack:

Command: /service

Give the name of the specific business service as the text argument of the command. Optionally, you can request supplemental information by adding "devices" or "events". Separate the supplemental information text from the resource name by a colon. For example:

/service <business_service_name>

To find the name of the business service you want to query, navigate to the Service Investigator page for that service in SL1 and use the name that displays after /services/ in the URL. Alternatively, you can use the name of the business service as it displays in the Name field in SL1.

This command will return and display the Name, Health, Availability, and Risk of the queried business service. You can also click a link to navigate directly to the business service in SL1.

/service <business_service_name> : devices

This command will return and display a list of devices within the queried business service, along with the Name, IP, and State of the devices.

/service <business_service_name> : events

This command will return and display a list of events associated with the queried business service, along with the Severity, event Message, and Aligned Entity Name.

Command:/device

Give the name of the specific device as the text argument of the command. Optionally, you can request supplemental information by adding "interfaces" or "events". Separate the supplemental information text from the resource name by a colon. For example:

/device <device_name>

To find the name of the device you want to query, navigate to the Device Investigator page for that device in SL1 and use the value that displays in the Name field in SL1.

This command will return and display the Name, State, Availability, Latency, IP, Message associated with the highest severity event on the device, and Latency of the queried device. You can also click a link to navigate directly to the Device Investigator in SL1.

/device <device_name> : interfaces

This command will return and display a list of the interfaces for the queried device, along with the Name, Utilization In, and Utilization Out.

/device <device_name> : events

This command will return and display a list of events associated with the queried device, along with a link to view the event in the Device Investigator in SL1.

Responding to Event Messages

When an event is posted in Slack, you can view details of the event, such as the Event ID, Event Severity, Affected Device, and more. You can respond to the event in Slack, to be updated in SL1 by adding a note, acknowledging the event, or resolving it:

  • Add Note to SL1 Event: Type the note you want to add to the event and press Enter. The note will be added to the event in SL1.
  • Acknowledge: Click this button to acknowledge the event in SL1.
  • Resolve: Click this button to resolve the event in SL1.

An image of the configuration object page.