This guide describes how to integrate your Zabbix installation with Matrix using the Zabbix webhook feature. This guide will provide instructions on setting up a media type.
The configuration of the webhook use Element to interact with the Matrix server, but receiving notification from Zabbix work with any Matrix client.
Visit app.element.io and create a new account for your bot.
Open a private/incognito window in you browser, and sign in app.element.io with the bot account:
Open the bot account settings pages:
In the settings page, open the Help & About
tab, scroll to the bottom Advanced
section and click on <click to reveal>
to retrieve the access token:
Finally, do not log out (logging out invalidate the access token), instead, just close the private/incognito window.
Invite the bot in the room you want the alerts to be sent.
In the room settings page, open the Advanced
tab and retrieve the Internal room ID
:
In order to configure the webhook, you will have to know:
First, import the Matrix webhook into your Zabbix installation:
- Use the
latest/media_matrix.yml
file for Zabbix 6.0 LTS and 6.2. - Use the
5.0/media_matrix.json
file for Zabbix 5.0 LTS.
Then, in the media type configuration, fill the <matrix_url>
value with the Matrix server URL and <matrix_token>
with the previously retrieved access token.
To add a link to the event in your alert messages, you need to fill the
event_url
parameter with the url below. Make sure that your replace<zabbix_url>
with the url of your Zabbix server.https://<zabbix_url>/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}
Finally, create or configure the Matrix
media type for your user, and paste the Internal room ID
in the Send to
field: