[ZBX-14997] Applying new templates erased the data on existing screens Created: 2018 Oct 11  Updated: 2018 Nov 06  Resolved: 2018 Nov 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Frontend (F), Templates (T)
Affects Version/s: 3.4.13
Fix Version/s: None

Type: Documentation task Priority: Minor
Reporter: Yordan Palikov Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: Screen
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File template-import-update-existing.png    

 Description   

Hello all,

After applying new templates on the hosts which we are monitoring, all the existing data on the screens created for performance tracking of different VMs was erased. It's a pity cause we put in so much effort to create every single screen for every host manually. Could you please advise how can we re-populate the missing data? Could this be automatically proceeded with a script? Thanks in advance!

Kind regards,
Yordan Palikov



 Comments   
Comment by Aigars Kadikis [ 2018 Oct 12 ]

Hello, Yordan,

Are you aware what does the checkbox "Dynamic item" do when you design a screen? This practically means if one template gets applied to multiple hosts it may be possible that we can create one screen, create multiple graphs and later you can do a graph overview across all hosts just because we got a similar item set from a particular template.

Kind regards,

Comment by Ingus Vilnis [ 2018 Oct 12 ]

There are very many things that can go wrong in the described process of template linkage. 

One that particularly comes in mind is that the templates were linked using Mass update feature having Replace and Clear when unlinking selected. Then all the existing items from hosts got removed and created again with other item IDs, of course not matching the ones in the graphs and screens anymore. 

Or another typical one could be that the new templates although meant as replacement are very different from the old ones thus again breaking all the previously configured functionality. 

Really hard to tell what has happened without knowing what was in the original templates, what was in the new and what steps were taken in the update. 

Database backup can be helpful to revert the changes back to how it was with the screens. Loss of collected after the backup is a downside of this approach though. 

Comment by Yordan Palikov [ 2018 Oct 12 ]

Hey guys,

Thank you for the quick response!
I guess I should tell you that this is regarding a template which was linked to all hosts with Windows OS which are approximately ~1500

@Ingus Mass update feature was performed and new template was added.
The difference between the old and the new template is that the old had items for all Windows network interfaces, while the new is monitoring only the 2 needed Windows network interfaces. Unfortunately this update was not performed by me, but as far as I know the items' IDs has been changed.

@Aigars all the items which were added to the screen were marked as "Dynamic item".
Each screen was defined with 3 items:
1 - Combined graph of the CPU utilization, Memory usage and Disc space.
2 - Graph for the number of IIS requests (minimum, maximum, average).
3 - Graph for the network performance (ingoing/outgoing traffic).

I guess the old data is missing already, so could you please advise if we should create a script for automatically implementing the new data on the screens via Zabbix API?
Wish you a great weekend!

Best regards,
Yordan Palikov

Comment by Aigars Kadikis [ 2018 Oct 23 ]

Hello Yordan,

API call can be a way to go. Please study:
https://www.zabbix.com/documentation/current/manual/api/reference/screen/create

For zero python knowledge here are some samples:
https://github.com/lukecyca/pyzabbix/tree/master/examples

Still, I cannot understand what type of screen situation we are dealing here. With a host count of 1500, I can imagine no more than 20 screens. I think the screen count should be very similar to the template count you are using. Are you using hundreds of templates?

Kind regards, 

Comment by Aigars Kadikis [ 2018 Nov 06 ]

Hello Yordan,

In a meantime I suggesting to play carefully when updating templates. One way how to approach it is:

  • export destination template to a new file
  • use some text editor to replace the template name to the active name (which is attached to hosts)
  • overwrite original template via update functionality and do not allow to create any new items

    in this case, the item ID's will remain the same which may lead for screens to not be broken.

Right now I will close this ticket as won't fix. If you see a better perspective on how to handle the scenario please share your thoughts via ZBXNEXT feature request.

Kind regards,
Aigars

Comment by Yordan Palikov [ 2018 Nov 06 ]

Hi guys,

Thank you so much for the effort!
I will study the options you recommended and if I still need your help I'll use ZBXNEXT feature.
Thanks again and have a great week!

Kind regards,
Yordan Palikov

Generated at Sat Apr 05 03:23:35 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.