Slack Notifier

The Slack Notifier posts a message to a Slack channel. The message is a summary of the latest state of an alarm.

Getting Started#

Setup Slack#

To enable alarms to be sent to the Slack channel, the following steps are needed.

  1. Visit the Slack API and create a new Slack app
Create new Slack App
Create new Slack App
  1. Select the feature “Incoming Webhooks”
Select Incoming Webhooks
Select Incoming Webhooks
  1. Activate incoming webhooks and select “Add New Webhook to Workspace”. Then select the channel you wish to post to
Activate Incoming Webhooks
Activate Incoming Webhooks
  1. Copy the new webhook URL which looks something like this https://hooks.slack.com/services/T123/B123/I123

This URL needs to be used when configuring the Curity Identity Server below.

  • hostname = hooks.slack.com
  • context = /services/T123/B123/I123

Create Curity Slack Notifier#

To create a new Email Notifier, navigate to SystemAlarm Handlers and click the New Alarm Handler button. Give a name to the handler and, select the Slack handler type.

Configuring a Slack alarm handler
Configuring a Slack alarm handler. (Admin UI version: 10.6)

Finally, provide the required configuration properties for the new handler and commit the configuration.

Configuration#

To configure the Slack alarm handler, an HTTP client needs to be configured, along with the path, host and port to connect to. No authentication necessary on the HTTP client unless required by a proxy to communicate from a run-time node to Slack.

The slack alarm handler is configured under configuration-reference/environments/environment/alarms/alarm-handlers/alarm-handler

ParameterDescription
slack-notifier/web-service/hostnameHostname for the slack api (hooks.slack.com)
slack-notifier/web-service/portPort of the web service (443)
slack-notifier/web-service/contextThe path on the web service to post to (/services/T123/B123/I123)
slack-notifier/web-service/http-clientThe configured HTTP client to use (under facilities)
# A configured Slack Notifier shown in the CLI

% show environments environment alarms alarm-handlers alarm-handler slack1
slack-notifier {
    web-service {
        hostname    hooks.slack.com;
        port        443;
        context     /services/T123/B123/I123;
        http-client trustStoreHttpClient;
    }
}

Message Format#

The Slack format is built to provide a Slack compatible message. By integrating with Slack, the alarm handler will produce nicely formatted alerts when an alarm is raised or cleared.

Slack message generated by alarm handler
Slack message generated by alarm handler

Was this helpful?