Importing and exporting templates

When we have templates made in Zabbix, it makes sense to back them up in case we want to use them later or to share them with, for instance, the community. In this recipe, we will show you how to import and export templates in Zabbix.

Getting ready

What do we need for this recipe? We need our Zabbix server properly set up. For this setup to work we also need an administrator or super administrator account.

How to do it...

  1. To export our template, we have to go in our menu to Configuration | Templates.
  2. Next, we select the template that we would like to export and select Export selected from the dropdown box.
  3. Click on Go, now Zabbix will export the template in XML format to our disk.
    How to do it...

When we want to import templates we have to follow more or less the same steps:

  1. Our first step is to go to Configuration | Templates.
  2. On the upper right corner, click Import.
    How to do it...
  3. We now see a box where we can select the file that we want to import.
  4. Make a selection of the possible options. There is a column to update missing data in case our template was already installed on our system and we wanted to update it with new features. We also have a column for new templates in case we don't want to install everything from our template. When importing hosts / templates using the Delete missing option, host / template macros not present in the imported XML file will be deleted too.
    How to do it...

How it works

Importing and exporting templates is very straightforward. When we want to export a template, we only have to select what template we want to export and click on the Export button. Zabbix will export the template in a file that we can download. The format of this file is XML.

When we want to import templates we have some more options. When importing templates we have the options to update existing templates or to import them and make a choice of what we would like to import.

There's more...

Besides templates, we can export and import also hosts, host groups, network maps, images, and screens. Images are exported in a Base64 format.

Import and exporting templates can be useful in case you want to back up your templates. It can also be useful if you have a development and a production environment. This way you could develop and test everything first on the development machine, export templates and import them on the production environment.

Another way is to share them with the community (I highly recommend you to do this).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.124.24