Skip to content

Slack Media Type

Video Lecture

Slack Media Type

Description

We set up a Slack Media Type for Trigger alerts in Zabbix.

  1. Create or join a Workspace

  2. Create a Channel

  3. Create an App.

  4. In Your-App ⇾ Features-OAuth & Permissions ⇾ Bot Token Scopes, Add the OAuth Scope chat:write

  5. Press the button Install App to Workspace

  6. Allow your APP to access your workspace so that it can send messages to your new Channel.

  7. Copy the Bot User OAuth Access Token and place it in the Zabbix Slack Media Type Bot Token field.

  8. Enable the Slack Media Type

  9. Add the Problem and Problem Recovery templates to the Slack Media Type

  10. In Slack, go to your Channel, and press the Add an app option, and Add your APP.

  11. Add a global Macro for {$ZABBIX_URL} and set its value to the full url of your Zabbix system. This will be used in the Slack messages to create a link to the problem information contained in the Zabbix UI.

  12. Add the Slack Media Type to your user, and select which severity to receive alerts for.

  13. Ensure the Trigger Action for Report problems to Zabbix administrators is enabled.

Optional

slack_mode

  • alarm (default)
    • Update messages will be attached as replies to the Slack message thread
    • Recovery messages from Zabbix will update the initial Problem message
  • event
    • Recovery and update messages from Zabbix will be posted as new messages

Troubleshooting

If you get an error "no message for media type", then go into the Media type settings, and then its Message Templates tab and then add the Problem and Problem Recovery templates if they don't already exist, and then update.

If you get an error "not in channel" when sending the alert, you need to add your Slack APP to your Channel using the Slack UI.

Comments