Skip to content
rozetko edited this page Jan 19, 2021 · 2 revisions

Hastic can send alerts to Slack via Web API. You need to set the following variables in config.json:

  • HASTIC_ALERT_TYPE=slack
  • HASTIC_SLACK_API_TOKEN=xoxb-54309684609-1647159624051-nvrG4vVMCapH1aFwcgAja5TI
  • HASTIC_SLACK_NOTIFICATION_CHANNEL=hastic_notifications

Getting token

  • Create a Slack app
  • Click the OAuth & Permissions tab in the left sidebar
  • Below Bot Token Scopes, select the scopes you need. Then click Add an OAuth Scope.
    • chat:write (required) - for sending notification
    • files:write (optional) - for attaching images to notifications
  • Copy token from Bot User OAuth Access Token

Adding bot to channel

  • go to channel you want to get alerts to
  • open right-side Details pane
  • click More
  • click Add apps
  • selected the app created at the previous paragraph

image

See article in Slack documentation for more info

Clone this wiki locally