Skip to main content
Skip table of contents

Slack

Feature

Germain Alerts can automatically be displayed onto your Slack channels.

Example of Slack Integration for Germain UX
Example of Slack Integration for Germain UX

Examples of Slack Integration for Germain UX

Configure

Germain integrates with Slack using the Germain’s HTTP actions. In this use case, Slack API allows you to post your critical alerts (triggered by configurable SLAs or Schedule) as messages to a Slack Channel in real-time.

Create Slack App

If you have not already done so, you will need to create a Slack App and grant the App required permissions. Please follow the quick guide here to do so. Also ensure to grant the App “chat:write.public“ permission, in case it was not mentioned in the guide link provided.

After completing the setup, the minimum permissions required are shown below.

Minimum permissions required by Slack App to post messages to channel

Minimum permissions required by Slack App to post messages

Automate posting of Germain Alert into Slack

Posting a new message can be done by doing a HTTP POST request to the Slack endpoint as shown by below call.

CODE
curl "https://slack.com/api/chat.postMessage" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--header "Authorization: Bearer xoxb-your-token" \
--data "{'channel': 'YOUR_CHANNEL_ID','text':'Germain has detected CPU Utilization is 91% which is higher than the normal percentage.'}"

This same scenario can be automated with Germain HTTP Action by following the below steps.

Germain Workspace > Left Menu > Automation > HTTP

HTTP Actions view on the Germain Workspace UI

HTTP Actions view on the Germain Workspace

In this screen you'll be able to easily spot which HTTP actions are available and configured to trigger on SLAs.

Clicking on an existing action will bring you to the respective configuration page.
In order to create a new HTTP action we'll click the + symbol up top which will bring up our HTTP Action Wizard

Step 1 - Action

First page of creation wizard of a new HTTP Action showing the required fields

HTTP Action creation wizard - General details

Type in the action name, “Slack Message Creation - CPU Alert”, Execution count as 1 and click Next.

Step 2 - HTTP Request

Second page of creation wizard of a new HTTP Action showing the required fields

HTTP Action creation wizard - API details

Type in the details as per the below table.

Field

Value

Path

https://slack.com/api/chat.postMessage

Request Method

POST

Content Type

application/json

Request Body

CODE
{
  "channel": "YOUR_CHANNEL_ID",
  "text": "Germain UX has detected that the ${context.kpi.name} of ${context.displayValue} on <#if (context.fact.system)?? ><#if context.fact.system.name?has_content >${context.fact.system.hostname?html}</#if></#if> has exceeded the defined Service Level Agreement of <#if (context.threshold.thresholdValue)?? >${context.threshold.thresholdValue} <#else>${context.sla.thresholdValue}</#if>%."
}

Expected Response

201

HTTP Headers

Authorization: Bearer xoxb-your-token

Step 3 - HTTP Request

For this example, we would create a new Slack message once CPU Usage SLA has been breached.

Click Finish.

The above example while simplified showcases how simple it would be to configure automation of Slack message posting to a Channel using the Germain.

Component: Engine

Feature Availability: 8.6.0 or later

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.