Skip to main content
Ask Question
Cluster Monitoring
Asked a question 2 years ago

Monitoring integration with Slack

Where am I?

In Bright Computing, Inc. you can ask and answer questions and share your experience with others!

Slack integration script for Bright Cluster Manager

Slack integration with Bright Cluster Manager monitoring is available via a built-in action script.
This script can be found under /cm/local/apps/cmd/scripts/actions/post_to_slack_web_hook.py.

 

Slack authentication

The script requires a slack webhook to be configured (the configuration process is explained later in the article) in order to send messages to slack.

 

The supported authentication methods are:

  1. Passing the webhook url to the script as an argument in the monitoring configuration of Brightview or cmsh.
  2. Create a /root/.slackrc file and adding APP_SLACK_WEBHOOK=https://the-slack-url1

 

Configuring the Slack webhook

In Slack, find the "Manage Apps" option in the main slack menu. Open the "Custom Integrations" Menu.


 

Monitoring integration with Slack

 

Click add configuration.

 

Monitoring integration with Slack

 

Configure the webhook settings as per the example below. Once complete, click save.
Now copy the webhook URL.

 

Monitoring integration with Slack

 

 

Configuring a Slack action in Brightview

In Brightview, navigate to the monitoring pane, select "Actions" and create a new script action as per the screenshot below. Paste in your Slack webhook URL as a parameter. Click save once complete.

 

Monitoring integration with Slack

 

Finally, you will need to apply the action to a trigger.
Navigate to the monitoring pane, select "Triggers". Clone the existing "Failing health checks" trigger, call it "Slack Failing health checks". Complete, the configuration below by adding the "Send message to slack" as an enter action for the trigger. Once complete, click save.

 

Monitoring integration with Slack

 

Now, once a health check returns a fail, a message will be posted in slack.

 

Monitoring integration with Slack