Part 26: Zabbix the storyteller

Fairy tale time!

Can you create fairy tales with Zabbix? Of course you can! By day, I am a monitoring technical lead in a global cyber security company. By night, I monitor my home with Zabbix & Grafana and do some weird experiments with them. Welcome to my blog about this project.

We all know how Zabbix has the never-ending list of integrations for just about everything --need to integrate it with OpsGenie, PagerDuty, Teams, Slack or something else? No problem, there's probably a ready-made integration for that already.

But, based on questions I've received over the years at work, not everyone realises how utterly powerful the alert message templating engine is for you to create custom messages with the help of built-in macros and of course the user macros you can define . The default Zabbix HTML e-mail message template is very compact in its format, and for me easy to read, but years ago someone at work told me that the alerts were not easy for him to follow.

What I did back then was that I created an alert template of my own, which tells about the events in a bit different format, here's a short snippet from those alerts.

No alt text provided for this image

Fairy tale time!

Now that at home we have our almost-three-months-old-baby, I'm using her as the perfect excuse to make Zabbix alerts be like fairy tales. You know the drill. Your kiddo wants to hear a yet another story before he or she falls asleep, and you have already run out of fresh stories to read.

What if your Zabbix would generate fairy tales for you? Well, not really, but at least the following would make the stories a bit more amusing to you and very confusing to your kid.

Let's first create a new media type via Zabbix Administration --> Media types. For this, I just cloned the default HTML e-mail media type and gave it a name.

No alt text provided for this image

And then, my fantastic story template looks like this:

No alt text provided for this image

Add the template to user media type

Next, to actually receive these alerts, you need to configure your user profile and in its media types add the new media type.

No alt text provided for this image

Using the template

Getting the new template into use is easy; just go to Zabbix Configuration --> Actions and create a new trigger action with whatever conditions you like.

No alt text provided for this image

No alt text provided for this image

And then on Operations tab make Zabbix send the alerts via your new fairy tale media type.

No alt text provided for this image

The alert e-mail

So this is how the e-mail looks like.

No alt text provided for this image

Now go and add some CSS, pictures, whatever you like to your stories. And, perhaps, unlike me, go and change the {ITEM.DESCRIPTION} macro to contain also some instructions what to do with the alert, like at our custom alerts at work I have a tendency to add some hints about how to resolve the issue.

I have been working at Forcepoint since 2014 and I would have many stories to tell you about all these years.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Buy me a coffee

Like these posts? Support the project and Buy me a coffee