Have you recently updated your Zabbix environment but are still wondering – why haven’t the templates been updated? Where can I obtain the latest official Zabbix templates, and how should I update them? In this blog post, we will discuss why it is vital to keep your templates up to date and how we the template update process looks like.
Updating your templates
“Will updating Zabbix also update my templates?” is a question that I receive quite often. The answer to that question is – no changes are made to your templates whenever you update your Zabbix instance – be it a minor or a major update. The reasoning behind that is quite simple – we always recommend that you tune the out-of-the-box templates as per your particular requirements. That may consist of changing update intervals, disabling items/triggers, or even changing the existing trigger expressions or adding whole new entities to the template.
This is where the current behavior with template updates starts to make more sense. If Zabbix were to automatically update your templates, there could be a chance of overwriting your custom changes and could potentially disrupt the monitoring of your environment. That is something that we definitely wish to avoid.
The question still stands – Then how am I supposed to update my templates?
The answer – you can find the latest official Zabbix templates on our official git page – https://git.zabbix.com/
First, navigate to the Zabbix repository and open the Templates folder. Then, select the release branch that matches your Zabbix instance version. Here you can find all of our official templates and also the official media types under the media folder. All you have to do now is open the template up and download the raw template file.
Zabbix 5.4 release git templates/db folder
Once that is done, we can import the template into our Zabbix environment
Template template_db_oracle_agent2 import
Don’t forget to back up your existing templates, especially if you have made some custom changes to them! Ideally – add a prefix to their names, so the new and old templates can live side by side, and you can then manually copy over the changes from the latest official template to your custom template.
The benefits of keeping templates up to date
But what is the point of updating your templates – what do you get out of it? Well, that varies on the specific fixes or improvements we make to the particular template over time. Sometimes the updated template will provide improved trigger expressions or preprocessing logic. Other times the updated template will provide extra value to your monitoring with completely new items and triggers. In the case of Webhook media types – the updates usually contain fixes or improvements for some particular use cases, for example – fixing a compatibility issue for a specific OS.
You can always track these changes either in the release notes of a particular Zabbix version or by looking up a specific bug or a feature request in our bug tracker – https://support.zabbix.com
Some of the template changes in Zabbix 5.4 major update
Zabbix self-monitoring templates
Another key aspect of why it’s important to keep your templates up to date is so you can implement the changes made to the Zabbix self-monitoring templates. For example, if we compare Zabbix 5.0 to Zabbix 5.4, there are multiple new Zabbix processes and caches added to Zabbix 5.4, such as report writer/manager process, availability manager process, trend function caches, and other new components.
Zabbix server health template version 5.0 and 5.4 difference in the number of entities
So, if you update from Zabbix 5.0 to 5.4 (or Zabbix 6.0 if you’re sticking with LTS versions), you WILL NOT be monitoring these processes and caches if you don’t update your Zabbix server and Zabbix proxy templates to the current Zabbix versions. This means that you will be completely unaware of any potential performance issues related to these processes or caches.
Tracking template changes
With Zabbix 5.4 and later, you will notice some great improvements to the template import process. If you’re wondering what has changed when comparing an older template version with a newer one, you will now be able to see the changes during the import process. The added and removed elements will be highlighted in red or green accordingly.
Preview of the changes made during the template import process
How often should you update the templates? Ideally, you would follow the Zabbix update release notes and take note of any changes made to the templates that are of use in your environment. At the very least – definitely check for changes in the self-monitoring templates when moving to a newer major version of Zabbix. Otherwise, you risk losing track of potential issues in your Zabbix environment.
Now that you know the answer to the question “How can I update my Zabbix templates?” try and think back to when you last updated your Zabbix instance to a new version – did you also check the official templates for updates? If not, then don’t hesitate and visit https://git.zabbix.com/ to find the latest templates for your Zabbix version. Chances are that you will be pleasantly surprised with a set of new and updated templates for your monitoring endpoints and new webhook media types to help you integrate Zabbix with your existing systems.
This is good to update one single template but how do we update all of them?
A medium environment might uses like dozen and dozen of different templates and now the templates are also split in modules so that is even more difficult.
Why not have a feature in zabbix to upgrade templates directly from the git repository?
Thank you for this article which reminded me that my templates are very old.
How am I able to do this? When I rename an existing old template and import the new one, the new one still replaces the existing one. I assume this is done via the uuid. Should I change the uuid in the imported yaml?? And how am I able to “copy over the changes”?
I am afraid of loosing 1. changes in the templates and 2. historical data (e.g. because I changed the trend values).
Thank you again for your help.
You are correct about UUID as the reason for overwrites!
I suggest simply “Exporting” the old templates out and storing them in a backup folder – backing them up that way.
This is really nice, but why the templates can’t have a origin URL and system can try to check (manually or automatically) for updates automatically and report if there are updates?
As others pointed out, it is very cumbersome to download many templates one by one and import. Especially the templates which are linked to many others.