Zabbix - Configure Email Notifications
Introduction
Configuring Zabbix to email you whenever something happens, is not as straight-forward as you may expect. It is divided into three stages that we will cover in this tutorial, which are to:
- Create an email media type for inputting the SMTP configuration details.
- Create a trigger to use this media type whenever something happens.
- Edit your user's so that their email addresses are in the system and configure the alert levels they wish to subcribe to and appropriate time ranges to be notified within.
Steps
Configure Email Media Type
Click on Administration (1) and then Media types (2) before either clicking on the name of an existing media type for email to edit it (3), or click on Create media type (4) to create a new one.
Fill in the media type for an email. Below is an example configuration for configuring SMTP against Amazon. Obviously you will need to specify settings that your SMTP server expects, but I would think they would be similar to this. The only difficult part was the "SMTP helo" which is just the domain you are sending with. E.g. "programster.org".
Configure Email Trigger Action
We've only configured the settings for Zabbix to be able to send an email. Now we need to tell it to actually bother using those settings to send an email when something happens. This is done by configuring a "Trigger action".
Click on Configuration (1) and then Actions (2). Then either click on an existing action to edit it (3), or click Create action (4) in order to create a new action.
Give your action an appropriate name.
Click on the Operations (1) tab, and then click on Add (2) in the operations section.
The following dialogue will appear. Click on Add (1) in the Send to user groups section if you wish the email alert to be sent to a user group, such as "administrators".
Then select the group(s) from the list that you wish to be notified.
Back at this menu, click on the Add link within the "Send to users" section if you wish to send to a particular user.
Select the user(s) you wish to be notified.
Click on the dropdown and select the email media type you created/edited earlier.
Configure User Emails
Thus far, we have configured the SMTP "media type" so that Zabbix knows how to send an email. We then configured a trigger, to send an email to a user group or a particular user. Now we need to edit our users, to specify their email addresses, and possibly assign them to the relevant user groups.
Click on Administration (1) and then Users (2). Then click the username of the user you wish to edit (3)
Click on the Media tab (1), and then either edit (2) an existing media type if you have already configured email, or click Add (3).
Set the type (1) to the name you set for the email media type in the first section of this tutorial (1), then enter the email address of the user (2). Review the other settings (3) to possibly change the levels at which the user wishes to subscribe to notifications, but I found the defaults were fine. Then click Add (4).
Conclusion
That's it. Email notifications should now be enabled.
First published: 14th June 2024