[ZBXNEXT-1305] Template with Linked Template (both with LLD) not export any data except the link to template Created: 2012 Jul 05  Updated: 2023 Jan 27

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F)
Affects Version/s: 2.0.0
Fix Version/s: None

Type: Change Request Priority: Major
Reporter: Adail Horst Assignee: Unassigned
Resolution: Unresolved Votes: 27
Labels: discovery, export, lld, templates, xml
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CENTOS 6 With MySQL


Attachments: JPEG File ScreenHunter_03 Jul. 05 16.42.jpg     JPEG File ScreenHunter_04 Jul. 05 16.42.jpg     JPEG File ScreenHunter_05 Jul. 05 16.43.jpg     JPEG File ScreenHunter_07 Jul. 05 16.47.jpg     XML File zbx_export_templates_TemplateA.xml    
Issue Links:
Causes
causes ZBX-16526 Zabbix API does not allow import temp... Closed
Duplicate
is duplicated by ZBXNEXT-8104 ability to fix child template changes... Closed
is duplicated by ZBX-6364 Prototypes are not exported if they b... Open
is duplicated by ZBX-11999 Export templates - inherrited low-lev... Closed
is duplicated by ZBX-21931 modifications of inherited triggers m... Closed
is duplicated by ZBX-6482 Exporting Host Does Not Include Items... Closed
is duplicated by ZBX-13281 Item prototype missed in exported .xml Closed
Sub-task
depends on ZBX-15326 Dependent item is not exported if mas... Reopened

 Description   

I have:
Template A: Descoberta de Interfaces - Switch - LAN
Template B: Descoberta de Interfaces - Roteador WAN

Template B are linked to Template B.
Template A have many Items and Item Prototypes.
Template B have Template A data + new Items Prototypes

I try to export Template A: OK works
I try to export Template B: Works on interface, I open the XML and only link information and name of Template A and B is on the file. The new Items, Items prototypes, etc are missing.

I try this in Zabbix 2.0.1 and Zabbix 2.0.2rc with a build of today.



 Comments   
Comment by Adail Horst [ 2012 Jul 05 ]

This XML have the data from Template A (template A are linked to another template (template C) but this template C dont have prototypes and are exported without problems).

Comment by Alexey Fukalov [ 2012 Jul 06 ]

Yes such problem exists, but for now it works as designed, i.e we export only objects that are not inherited from template or are not dependent on inherited object.
Same can happen for example if you change dependencies for inherited trigger, or related applications for inherited item, these changes cannot be exported.

I move this to ZBXNEXT because it's improvement of current export functionality.

Comment by Kay Schroeder [ 2016 Jan 07 ]

I'm using this functionality of zabbix also to avoid generating items that will become unsupported. Unfortunately I working with two zabbix installations. One testing, where I develop Templates and the other one where I have the productional montoring installed. Unfortunately at the moment I have to create These templates twice.

Comment by Ivan Vanyushkin [ 2016 Sep 27 ]

Is there any workaround to export template with item/trigger prototypes, in case of linked discovery rules? I need to move my new item/trigger prototypes to other Zabbix server, but I see no way to export them.

Comment by Robin Roevens [ 2020 Feb 07 ]

This does not only apply to item/trigger prototypes but also on overrides of normal items/triggers.

For example:

  • Template A defines system.name
  • Template B inherits Template A, but overrides Update Interval, Storage Period and Inventory Field of system.name
  • Export Templates A and B
  • Import Templates A and B on a different zabbix server (or first delete templates A and B and then import them again)
  • Template B now just inherits Template A and all overrides on system.name are gone.

I've read that this is currently as designed but I think this is quite a flaw. When you export a configuration, you expect that it gets exported exactly as it is configured.

We also have 2 zabbix environments : dev and prod .. with an automatic export to git on dev and an automatic import from git to prod..

But now it turns out that those changes do not get exported .. so are not tracked in git and thus not imported in prod. Which currently even makes a few template imports fail due to overrides that should prevent conflicts are not exported..

If Zabbix wants their templates to be truly modular and world shareable, I think this issue should be addressed asap. As the only solution now is to start duplicating templates and/or integrating templates into each other to be able to define such overrides.

Meanwhile, I think the GUI at least should display a big fat warning that such things as changes on inherited items/triggers or discoveries won't be exported. As well as in de API documentation of configuration.export.

Comment by Grant Ashton [ 2020 Feb 07 ]

Completely agree with @robinr

We have the same issue, as templates are distributed via git. So overrides to inherited LLD or normal items/triggers do not get exported.

The workaround, we use, to this is unlinking but not clearing the template, but this means items/triggers are essentially duplicated. So this makes maintenance a nightmare, as we have to track this duplication.

This is a fundamental flaw in the export/import design. Essentially ruining the major benefit of template inheritance

Comment by Patrice Gautier [ 2020 Nov 18 ]

Another vote to fix this.

This limitation completely destroys the usefulness of the template inheritance concept, since there really is no clean way to transport the hierarchy to another system.

Distributing those templates to other people via git is also a non starter

 

Comment by Chris Brookes [ 2021 Mar 22 ]

Adding another vote. That the additional item & trigger prototypes are missing in an export of the child template is a) causing us lots of headaches, and b) going against reasonable expectations.

Comment by Bogdan Rudas [ 2021 Apr 27 ]

Configuration loss during template export and import is awful. While entire mechanics of inheritance is acceptable, any modern deployment need a staging environments for monitoring system. It is absolutely impossible neither do an automation nor manually move templates between hosts once we are using something added to Zabbix after 1.4.x series in templates.

Comment by Pierre Fagrell [ 2021 Jul 24 ]

This really hinders adoption of Zabbix with multiple servers.

If we want to export templates from one server and import on another we cannot use inheritance and overrides at all. Adding item prototypes to inherited discovery rules does not work either.

I really hope this can be fixed.

Comment by Mathew [ 2022 Apr 19 ]

Heres an unofficial fix.

https://github.com/X4BNet/zabbix/commit/c91d4d7266c50859b7da68dde854127385ac3458

I release this work commit into public domain. Do with it what you will under any licence or for any purpose. It comes with no guaruntees of completeness or finess of purpose.

 

Comment by Richard Ostrochovský [ 2022 Nov 16 ]

Update: ZBX-21931 modifications of inherited triggers missing in templates' configuration export - ZABBIX SUPPORT

Comment by Alexander Vladishev [ 2023 Jan 27 ]

As of version 6.4.0 the nested template functionality will be removed, but the reported problem will still exist in host export.

Generated at Sat Apr 20 07:10:55 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.