Integration of Zabbix with Slack and Email

“Technology makes it possible for people to gain control over everything, except over technology.”John Tudor.

I’m trying to manage the bunch of Raspberry Pi 4B cluster nodes using the Zabbix Monitoring Tool. Please refer to my previous blog post on how to install and configure Zabbix containers here.

Zabbix is a pretty good and scalable monitoring tool. The best thing is it’s OSS and has got a lot of community support. In this blog, I’ll walk through the integration between Zabbix and Slack also the traditional email systems.

Follow the below steps to integrate Zabbix with Slack

  • Download the YAML file media_slack.yaml for Zabbix 5.4 from Zabbix Git repo
  • Delete the existing Slack from media types located under ‘Administration’
  • Import the file downloaded from Zabbix to create a new media type
  • Create a User Bot, Copy token and assign Bot Token scope –
  • Edit the Slack Media Type by adding Bot User Token, Slack Channel Name
  • Set slack_mode to ‘alarm’, Update Zabbix URL with the new macro
  • Enable the media type and click on Update
  • Validate all the settings and enable the media type
  • Trigger test alert and see if you’re getting the slack message
  • If not, troubleshoot by repeating the above steps – monitork3s is the bot user and User OAuth Token is hidden here
Added chat: write, groups: write and im: write permissions for the bot user monitork3s
Go to Administration > General > Macros
New Macro {$ZABBIX.URL} created with a value of Zabbix Server UI URL. Please replace with FQDN of the Zabbix UI server.
Click Media Type under Administration
Delete the existing Slack media type and click on ‘Import’
Select the downloaded file ‘media_slack.yaml’ and Import.
Open the media type slack and make the changes as shown above and follow the next screenshot
Click on Update after making highlighted changes
Click on Test and follow the prompts by updating necessary fields
If Test is successful, a sample message will be shown in Slack
Sample alerts show the problem and resolved states. This is when we set the slack_mode as ‘alarm’

Follow the below steps to configure email alerts

  • Go to Media Type and select Email HTML
  • Add email server address, username, password and port details (I’m using GoDaddy)
  • Validate all the settings and enable the media type
  • Trigger a test email and see if email message generated successfully (check SPAM folder as well)
  • If not, troubleshoot by repeating the above steps
Select Email (HTML) from the media types
Update all the highlighted fields and click on Update
Test message received successfully

Source and References

Zabbix: Slack Media Type

Image Courtesy:

Thank You for stopping by

If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend or sharing it on your social platforms. Thank you!

What am I missing here? Let me know in the comments and I’ll add it in!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s