Applicable for ENA v23.0 P01 upwards.
To create a custom Slack app with webhooks enabled
To set up the Slack configuration file
EMS actions that forward events and incidents to Slack
Important note for multi-server configurations
To forward events from Entuity to Slack
To forward incidents from Entuity to Slack
Events and incidents are forwarded to Slack using incoming webhooks from a custom Slack app that you must create.
To create a custom Slack app with webhooks enabled:
Before you can forward events and incidents to Slack, you must create a custom Slack app to set up incoming webhooks. To do so, follow these instructions provided by Slack.
Upon creating the custom Slack app and setting up incoming webhooks, you can copy the webhook URL, and then follow the instructions in this article to forward either events or incidents from Entuity to Slack.
To set up the Slack configuration file:
- Navigate to the
Slack-example.cfgfile, located in the entuity_home/etcdirectory. - Using this example, create a
Slack.cfgfile, and save it to the same entuity_home/etcdirectory. -
Update the '
default' section or add a named section to the file for each Slack channel.
For example:
[default]
host=hooks.slack.com - Save the file, and then stop and restart Entuity.
Note, you can enter the section name (default in this example) in the cname parameter later when you configure Entuity to forward events and incidents.
EMS actions that forward events and incidents to Slack
As of Entuity v23.0 P01 upwards, there are two EMS actions for forwarding events or incidents to Slack: 'Send to Slack' and 'Send to Slack Queue'
The 'Send to Slack' action forwards each event or incident directly to Slack, while the 'Send to Slack Queue' action forwards events or incidents to Slack through a queue from the Message Broker. Sending through a queue helps prevent communication or connection errors during the forwarding process, as messages remain in the queue until successfully acknowledged by the target endpoint. A message queue log file is also created when using the 'Send to Slack Queue' action. For more information on message queues, see this article.
For information about EMS actions, see What are EMS Actions?.
Important note for multi-server configurations
After making changes to an EMS project on one server of your multi-server environment, such as setting up event rules or triggers (as described in the next sections of this article), export the edited EMS project and then import it to the other Entuity servers in your multi-server configuration. This keeps the servers in sync. To do so, follow the instructions in this article.
To forward events from Entuity to Slack:
Forward events to the Slack integration by setting up an event rule:
- From the Main Menu, click Administration, and then click Event Administration.
The Event Administration page is displayed. - Click the Rules tab.
- Select Post Storage in the tree on the left, and then click Add Rule at the bottom of the window.
The Add Rule window is displayed. - Ensure the Type field is set to 'Generic', and the enabled checkbox is selected.
- Complete the Name and Description fields, as appropriate.
- Leave the Condition field as 'None'.
-
In the Action Steps section, click Add to open the Add Action window.
- From the Type dropdown field, select 'Send to Slack' or, from Entuity v23.0 P01 upwards, 'Send to Slack Queue'.
- In the Parameters field, select the '
cname' parameter and click Set.- Enter the value of the '
cname' parameter in the Value field (defined in the Slack configuration file), and then click OK.
- Enter the value of the '
- In the Parameters field, select the '
path' parameter and click Set.- Set the Value field to the webhook path that defines the Slack channel to which the events will be forwarded, and then click OK.
- Click OK to save and close the Add Action window.
- If you want to forward events to multiple Slack channels, repeat step 7 and specify the unique webhook path for each channel.
- Click OK to save and close the Add Rule window, and then click the Save icon in the top-right of the Event Administration page to save the event project.
-
If you selected the 'Send to Slack Queue' action step in step i (Entuity v23.0 P01 upwards), choose whether to execute callback actions by optionally using the 'Response Callback' action. Do one of the following:
- If you want a 'Response Callback' action executed when event and incident data is sent to the Slack integration:
- Keep the '
callback' parameter in the 'Send to Slack Queue' action step. - Go to the Actions tab of the Event Administration page, create a Slack-specific 'Response Callback' action, and within that action, define an action to execute upon receiving a response from the Slack integration.
- Return to the 'Send to Slack Queue' action step in the new rule from the Rules tab (for events) or in the new trigger from the Incidents tab (for incidents) on the Event Administration page.
- Enter the name of the newly created 'Response Callback' action as the value of the action step '
callback' parameter. - Save the rule or trigger, and then save the event project.
- Keep the '
- If no 'Response Callback' action is required:
- Return to the 'Send to Slack Queue' action step in the new rule from the Rules tab (for events) or in the new trigger from the Incidents tab (for incidents) on the Event Administration page
- Set the value of its '
callback' parameter to null, without quotes. - Save the rule or trigger, and then save the event project.
Note, if events are forwarded through message queues, the 'Set Attribute' option can't be used as a 'Response Callback' action. However, you can use other options in the 'Response Callback' action, such as 'Create Event'. - If you want a 'Response Callback' action executed when event and incident data is sent to the Slack integration:
To forward incidents from Entuity to Slack:
Forward incidents to the Slack integration by setting up an event trigger. You can configure a global trigger so that all incidents are forwarded to the server, or configure individual triggers so that only individual incidents are forwarded:
- From the Main Menu, click Administration and then click Event Administration.
The Event Administration page is displayed. - Click the Incidents tab, and then click Edit Global Triggers at the bottom of the window.
The Edit Global Triggers window is displayed. - Click Add to open the Create Trigger window.
- Complete the Name and Description fields, as appropriate, and ensure that the enabled checkbox is selected.
- Ensure that the On Transition To dropdown field is set to 'Any Change' so that all incidents raised against the same source are sent to Slack.
- In the Condition dropdown field, select 'All tests must succeed', which updates the window.
- In the Tests section, click Add to open the Add Test window.
- In the Type dropdown field, select 'Incident Severity Test'.
- In the Expression dropdown field, specify the severity level you want to forward.
- Click OK to return to the Create Trigger window.
-
In the Action Steps section, click Add to open the Add Action window.
- In the Type dropdown field, select 'Send to Slack' or, from Entuity v23.0 P01 upwards, 'Send to Slack Queue'.
- In the Parameters field, select the '
cname' parameter and click Set.- Enter the value of the '
cname' parameter in the Value field (defined in the Slack configuration file), and then click OK.
- Enter the value of the '
-
In the Parameters field, select the '
path' parameter and click Set.- Set the Value field to the webhook path that defines the Slack channel to which the incidents will be forwarded, and then click OK.
- Click OK to save and close the Add Action window.
- If you want to forward incidents to multiple Slack channels, repeat step 7 and specify the unique webhook path for each channel.
- Click OK to save and add the trigger, and then click the Save icon in the top-right of the Event Administration page to save the event project.
- If you selected the 'Send to Slack Queue' action step in step i (Entuity v23.0 P01 upwards), choose whether to execute callback actions, the same way as step 10 of the event process.
Comments
0 comments
Please sign in to leave a comment.