Nesting templates

It is also possible in Zabbix to link templates with each other. This may sound weird and unnecessary at first but it's definitely a great feature. Imagine you have a web server with Apache, MySQL, and PHP. You could create 1 big template to monitor all items or you could create 3 templates. One for Apache, one for MySQL, and another one for PHP. But what if you have another web server that you would like to monitor? Do you add those three templates again to that host? What you could do in this case is create a new template Webserver and link it with the three templates we mentioned earlier. In this case, we only have to link 1 template Webserver to our webserver and we can still use the template Apache or MySQL in case we only want to monitor Apache or MySQL on another server.

Getting ready

To be able to do this recipe, you need a Zabbix server properly set up with an admin account or super administrator account setup.

How to do it...

  1. From the menu go, to Configuration | Templates.
  2. Click Create New Template.
  3. Fill in the Template name, example. Webserver Template.
  4. Add it in the group templates.
  5. Select Linked templates from the tab on top.
  6. In the box Link new templates, click the Select button.
  7. From the popup window select Template App HTTP Service and Template App Mysql.
  8. Click the Select button at the bottom.
    How to do it...
  9. Back in the menu Linked templates, you now see the two templates we have selected, we still have to click Add.
  10. And finally click Update.

How it works

In the template menu we just create a new template. This template we link to two or more templates so that our new template will inherit all of the items of the linked templates. Our new template will then be linked to our host. This way we don't have to link two templates to our host but only one. Later it is possible to link more templates to the new template we have made.

Tip

In the Link new templates box, it is possible to type the name of the template if you know the name or part of the name, and then select it from a popup window.

There's more...

When we go back to the menu Configuration | Templates, we will see our template web server and in the column Linked templates we will see the names of the templates linked to our new template.

There's more...
..................Content has been hidden....................

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