Zabbix v6 Slack Notifications
Preparing Slack
Start by creating a Channel for the Zabbix bot:
Now click to add a new app and click on the link in the top right that leads you to the App Directory that will open the Slack webpage inside your default browser. In the top right click on the Build tab and then on the big Start Building button.
Give your app a name and assign a workspace then click on Create App. In the following list select Bots:
There we need to assign a scope to your bot token. Click on Review Scopes to Add:
Add the chat.write
scope and click on Install App to Workspace and give permission to your bot to access your workspace. You will now be given a token that you have to copy into the Zabbix interface so that Zabbix will be able to use the bot to send messages to your workspace:
Configure Zabbix
Open the Zabbix dashboard, enter the Media types configuration and select the Slack media type:
Copy your bot token in to the bot_token
field and set the channel we want to bot to post into - click on Update to save your settings. Before using the Webhook, you need to setup the global macro {$ZABBIX.URL}
, which must contain the URL to the Zabbix frontend - go to Administration / General / Macros:
Test the bot (the Test will complain about some undefined variables - you can fill them with dummy data:
Now the test runs successfully and you should receive the test message in #server_management
:
Great! Now we can add the Slack notification as a Media Type inside our user notification settings:
Make sure that reporting problems to Zabbix Administrators is activated and you are good to go: