How to Set up Email Alerts in Zabbix

When you manage a server, you want to know if something goes wrong. You don’t always have time to sit and watch dashboards. That’s why email alerts are helpful. They let Zabbix send you a message when there’s a problem. This way, you don’t miss important issues like high CPU load, low disk space, or a website going offline.

Zabbix is a monitoring tool. It watches your servers and services, then shows the data in graphs and lists. It also lets you set triggers and actions. A trigger is a rule that checks if something is wrong. An action is what happens when the trigger goes off—like sending an email.

In this article, I’ll show you how to set up email alerts in Zabbix. I’ll explain each part so it’s easy to follow, even if you’re new to Zabbix or server tools.


Why Email Alerts Matter

I use email alerts because they save me time. I don’t need to check Zabbix every hour. Instead, I get a message when something important happens.

For example, one night my server’s disk space was almost full. I didn’t know until Zabbix emailed me. If I hadn’t fixed it, the website could’ve crashed.

Here are some benefits:

  • You know when something breaks, even if you’re not near your computer.
  • You can act quickly before users notice.
  • You don’t need to watch your server all day.

There are other types of alerts too—like SMS, Telegram, or Slack—but email is simple and works almost everywhere.


What You’ll Need

Before we begin, make sure you have:

  • Zabbix installed and running
  • A working email account (Gmail, Fastmail, your own mail server, etc.)
  • Access to Zabbix’s web interface
  • Root or sudo access to the server (optional for testing mail)

You don’t need to be an expert. If you can use the terminal and a web browser, you’re good.


Step 1: Set Up the Mail Settings

Zabbix needs a way to send email. By default, it uses a method called sendmail, but you can also set it to use SMTP, which is more reliable.

Let’s use SMTP. That’s the same system email apps use to send messages.

Choose an SMTP Server

Here are a few SMTP settings you might use:

Provider SMTP Server Port Encryption
Gmail smtp.gmail.com 587 STARTTLS
Fastmail smtp.fastmail.com 587 STARTTLS
Outlook smtp.office365.com 587 STARTTLS

You’ll also need:

  • Your email address
  • Your email password (or an app password if using 2FA)

I recommend creating an app-specific password. It’s safer.


Step 2: Create a Media Type

A media type in Zabbix is how alerts are sent—like email, SMS, or a script.

To create one for email:

  1. Log in to the Zabbix web interface.
  2. Go to Administration > Media types.
  3. Click Create media type in the top right.
  4. Set the type to Email.
  5. In the SMTP server box, enter your SMTP server (e.g., smtp.gmail.com).
  6. Set the SMTP port to 587.
  7. For SMTP HELO, use your domain or server’s name (like myserver.local).
  8. In SMTP email, enter your email address.
  9. Choose STARTTLS as the security method.
  10. Check the “Authentication” box, then type your email login and password.

Click Add when you’re done.

You’ve now told Zabbix how to send mail.


Step 3: Add Your Email as a User Contact

Now we’ll tell Zabbix who to send the alerts to.

  1. Go to Administration > Users.
  2. Click on your username (or create a new user).
  3. Go to the Media tab.
  4. Click Add.
  5. For Type, choose the media type you created (Email).
  6. In Send to, type your email address.
  7. Set When active to 1-7,00:00-24:00 so it works every day, all day.
  8. Choose a severity (like High or Disaster) depending on what alerts you want.

Click Update when done.

Tip: You can set multiple contacts. I sometimes add a second email or even a script.


Step 4: Create an Action

An action tells Zabbix what to do when something happens.

To create one:

  1. Go to Configuration > Actions.
  2. Click Create action.
  3. Give it a name like “Send email on high CPU”.
  4. In Conditions, add something like:
    • Trigger severity = High
    • Host group = Linux servers
  5. Go to the Operations tab.
  6. Click Add.
  7. Choose Send to User: your username.
  8. Choose Send only to: your email media type.
  9. Save the action.

Now when a trigger with high severity fires, Zabbix will send an email.


Three Things That Can Go Wrong (And Fixes)

  • Emails don’t send? Check your SMTP settings and try logging in with them in a mail client.
  • Using Gmail? Make sure less secure apps are allowed or use an app password.
  • Still stuck? Look in Zabbix logs:
    sudo tail -f /var/log/zabbix/zabbix_server.log

Test the Email Alerts

Let’s test it. You can force a fake trigger like this:

  1. Go to Configuration > Hosts
  2. Click on your server
  3. Go to Items, then add a new item:
    • Name: Fake check
    • Key: system.run[echo 1]
    • Type: Zabbix agent
    • Update interval: 60s
  4. Save and go to Triggers
  5. Add a new trigger:
    • Name: Fake Alert
    • Expression: {YourHost:system.run[echo 1].last()}=1

This should fire and send you an email in about a minute.


Three Email Tips I’ve Learned

  • Keep alert messages short but clear.
  • Use a separate email account just for server alerts. It keeps your inbox clean.
  • Set filters in your email so Zabbix alerts don’t get lost.

Other Alert Options

Email is great, but you can also try:

  • Slack: Good for teams
  • Telegram: Easy on phones
  • Scripts: Run a script when something breaks (restart service, write to log)

I like email for most things, but I also use scripts for auto-recovery tasks.

Here’s a quick comparison:

Alert Type Setup Difficulty Good For
Email Easy Most users
Slack Medium Teams
Telegram Medium Personal use
Script Hard Advanced actions

Conclusion

Setting up email alerts in Zabbix might take a few steps, but once it’s done, it just works. You’ll know right away when something breaks. That can save you hours of headache—and maybe even save your server.

I use this on all my servers, even my small home lab. It gives me peace of mind knowing I’ll be notified if anything gets weird.

Have you tried email alerts yet? Or do you prefer another way? Either way, Zabbix gives you a lot of options.

Let me know if you want a guide for setting up Telegram or Slack alerts next.

Leave a Reply