This is a translation of the original English documentation page. Help us make it better.

Sidebar

Zabbix Summit 2022
Register for Zabbix Summit 2022

6 Nieuw template

Overzicht

In deze sectie leert u hoe u een template kan opzetten.

Eerder hebben we al geleerd hoe we een item en trigger kunnen opzetten en hoe we een probleem notificatie voor een host kunnen krijgen.

Hoewel al deze steppen op zichzelf een groot stuk flexibiliteit toevoegen, het kan erop lijken dat een heleboel stappen nodig zijn voor, bijvoorbeeld, hosts.

Dit is waar we templates gebruiken. Templates laten ons een groep maken van items, triggers en andere entiteiten zodat we die later weer kunnen gebruiken door ze met een enkele actie op meerdere hosts toe te voegen.

Wanneer een template aan een host gekoppeld wordt, dan krijgt de host alle entiteiten mee van het template. Zo kunnen we dus eigenlijk een boel checks erg snel toevoegen.

Adding template

To start working with templates, we must first create one. To do that, in Configuration → Templates click on Create template. This will present us with a template configuration form.

All mandatory input fields are marked with a red asterisk.

The required parameters to enter here are:

Template name

  • Enter a template name. Alpha-numericals, spaces and underscores are allowed.

Groups

  • Select one or several groups by clicking Select button. The template must belong to a group.

When done, click Add. Your new template should be visible in the list of templates.

As you may see, the template is there, but it holds nothing in it - no items, triggers or other entities.

Adding item to template

To add an item to the template, go to the item list for 'New host'. In Configuration → Hosts click on Items next to 'New host'.

Then:

  • mark the checkbox of the 'CPU Load' item in the list
  • click on Copy below the list
  • select the template to copy item to

All mandatory input fields are marked with a red asterisk.

  • click on Copy

If you now go to Configuration → Templates, 'New template' should have one new item in it.

We will stop at one item only for now, but similarly you can add any other items, triggers or other entities to the template until it's a fairly complete set of entities for given purpose (monitoring OS, monitoring single application).

Linking template to host

With a template ready, it only remains to add it to a host. For that, go to Configuration → Hosts, click on 'New host' to open its property form and find the Templates field.

Start typing New template in the Templates field. The name of template we have created should appear in the dropdown list. Scroll down to select. See that it appears in the Templates field.

Click Update in the form to save the changes. The template is now added to the host, with all entities that it holds.

As you may have guessed, this way it can be applied to any other host as well. Any changes to the items, triggers and other entities at the template level will propagate to the hosts the template is linked to.

Linking pre-defined templates to hosts

As you may have noticed, Zabbix comes with a set of predefined templates for various OS, devices and applications. To get started with monitoring very quickly, you may link the appropriate one of them to a host, but beware that these templates need to be fine-tuned for your environment. Some checks may not be needed, and polling intervals may be way too frequent.

More information about templates is available.