Zabbix integration with Slack


I want to be clear from the beginning, I am not going to write about Slackware (the distribution) but Slack (the platform/client chat).

Zabbix is a solution for monitoring applications, networks and servers. With Zabbix, you can monitor multiple servers at a time using a Zabbix server that comes with a web interface (which is used to configure Zabbix and has system graphics) and Zabbix agents that are installed on the systems that are going to be monitored. Zabbix agents deliver the desired data to the Zabbix server.

Slack – perhaps the most useful application when you are a manager and you have more people under your control. It works extremely simply and brings together the whole team. You can send messages to everyone at the same time, just like a chat room, making work together much easier. The app is similar to the Yahoo Messenger, but with many additions and created specifically for the business side, and has variations for all types of devices, from phones, laptops to tablets.

Some time ago I’ve been able to integrate Zabbix with a Zabbix client on iOS that has the ability to send push notifications when something happens in my infrastructure. This thing is no longer working on iOS 11 because the developer of the app has not updated it for the latest iPhone OS.
I did not want to activate email notifications, so I looked for other ways I could send the notifications from Zabbix and found the easiest way through Slack.

After doing a “market analysis” I said that Slack is the fastest and easiest method. Plus, the Slack registration lasts for 3 minutes (it took me more time to understand why I do not receive notifications on my phone as well). Slack it’s free; the application is multiplatform (Web, iOS, Android, Linux, Windows, Mac), and within 15-20 minutes you’re finished configuring Slack and Zabbix.

Steps for integration:

1. After configuring the Slack workspace, you need to enable webhooks in Slack. When configuring Webhooks, I chose a new channel instead of a user, even if I am a one-man show. You can configure to send notifications to multiple channels or more users. It’s useful when you have more people dealing with different things.
2. Download the script and put it in the alert folder in Zabbix. At this time, you can test if you’ve done the integration/configuration of Webhooks with Slack. If you can send messages from the shell, then you can go to the next step.
3. Configure in Zabbix a new media type, a new alert, a new action, etc. If you were able to send the test message in step 2, all you have to do is set up Zabbix to send alerts as you like.
4. Once you’ve set up Zabbix, you can stop the agent from a server and you can test if the notifications reach the Slack channel you choose.

By default, your mobile app does not notify you if you are idle on your PC application. Practically, as long as you do not use your mobile application (or as long as you’re logged in and using your PC), you get notifications only on your PC. This can be disabled in the application settings.

Recent Posts