When I try to update the templates after the upgrade to 6.0, I get a duplicate item key error. For example, Item with key "agent.hostname" already exists on "Linux by Zabbix agent". One solution was to rename the existing template with '-old.' This did not help. I renamed all the linked templates also. I know I have updated templates in the past with no issue, is there a step I am missing?
Ad Widget
Collapse
Unable to update existing templates Zabbix 6.0.4
Collapse
X
-
i have the same issue too
I'm trying to add kubenetes templates that depends on upgrading "Linux by Zabbix agent" template.
I've just upgrade from 5.4 to 6.0.3 -
The only solution that I've found: delete the "Template OS Linux by Zabbix agent" template as well as the "memory utilization" item from all hosts where this template where declared. After that, we can add the new template without any problem and link it to previous hosts.
I didn't see any regression.Comment
-
yeah, I've got the same error with "Item with key "agent.hostname" already exists on "Linux by Zabbix agent active".
Going from 5.x (exact version escapes me at the moment) to 6.0.3 via the upgrade path (so not a clean install).
Deleting the template (and the resultant item history is not a valid solution),
The templates that did work
- template_module_zabbix_agent.yaml
- template_app_zabbix_proxy.yaml
- template_app_vmware_fqdn.yaml
- template_app_vmware.yaml
- template_app_zabbix_server.yaml
- template_app_zookeeper_http.yaml
The templates that failed
- template_os_linux_active.yaml
- template_os_linux_passive.yaml
not seeing much help in google etc...Last edited by RichL; 16-05-2022, 07:29.Comment
-
Is there something that prevents you from Unlinking (not Unlink and clear) the template from the hosts and then adding the new template? I mean, Unlink keeps the items (and their data) in the host, and then you can link a new template that uses the same items. You can even do it in the same edit step (unlink and add new template).
Be sure to test this first before applying to your most important hosts.
MarkkuComment
-
Thanks, I gave your idea a shot, and it did produce different results, so that's a win :-)
Unlinked (but not cleared the Zabbix Agent template) from the "Linux by Zabbix Agent Active" base template and got a new item error, which I suspect will occur with each template I remove until all have been removed
- Item with key "kernel.maxfiles" already exists on "Linux by Zabbix agent active".
Removing the templates "Linux by Zabbix Agent" or "Linux by Zabbix Agent Active" on all my hosts is not something I want to do in this case as it feels a bit too high risk for something that looks to be a bug (not raised as one as yet, because it may not be a bug).
The really weird thing about all this is that agent.host name in the original error message is in a template "template_module_zabbix_agent.yaml" (that can be updated with no problems (in fact I did so).Comment
-
AFAIK, one of the changes announced with Zabbix 6.0 was that the supplied templates don't use "subtemplates" anymore, that are self-contained.
Anyway, the key is that in order to change the template for your hosts, you need to unlink the templates from the hosts, not from the other templates, as far as I see it. So don't go edit the templates, edit the test hosts.
MarkkuComment
-
Hi!
Same problem here (upgrade from 5.4 to 6.0).
Here is what I did (but I do not recommend on production system since I have not sufficient history to understand if I do not have any regression or item loss) and this is far from being a clean solution:
1/ Unlink (but not clear sub-module templates from "Linux by zabbix Agent Active");
2/ delete all the old templates (sub-module from Linux + "Linux by zabbix Agent Active" + "Zabbix agent active");
3/ import the 6.0 version of "Linux by zabbix Agent Active" and "Zabbix agent active".
4/ Relink everything.
You may also want to use the https://github.com/southbridgeio/zab...-export-import project to regularly export in a GIT repo templates and macros to track any changes.
I am really a big fan of the Zabbix solution but I do not understand why templates have always been so painful to manage (the relatively new diff import feature goes in the right direction though)...
Good luck!Comment
-
Yes I agree. Zabbix is great. My biggest problem is the way they handle the templates. We need built in versioning of templates. Once we upgrade to newer version of Zabbix, templates will still not be upgraded. But in the template section we see the newer version with the Diffs and Change Log for that template and one click upgrade or downgrade of the selected template.Comment
-
It is easy to find which hosts have a specific template. But once the template is unlinked from a host, there does not seem to be any way to find list of same hosts anymore. Is there a practical solution to this?AFAIK, one of the changes announced with Zabbix 6.0 was that the supplied templates don't use "subtemplates" anymore, that are self-contained.
Anyway, the key is that in order to change the template for your hosts, you need to unlink the templates from the hosts, not from the other templates, as far as I see it. So don't go edit the templates, edit the test hosts.
Markku
It is even worse if the template to be updated was linked to another template group. Then have to keep track of hosts which have the other template group also.Last edited by yurtesen; 09-01-2023, 10:58.Comment
-
I would definitely check using the API for such mass operation. Or, in the GUI, you could for example tag the hosts with some temporary tag so that you get the same list of hosts later again.It is easy to find which hosts have a specific template. But once the template is unlinked from a host, there does not seem to be any way to find list of same hosts anymore. Is there a practical solution to this?
MarkkuComment
-
I already considered your suggestion. It works fine if the template is directly linked to the host. I could set a temporary empty template and assign using mass update. But I have template groups and for each group I need to make different tags etc. so I can assign the same template group back to correct hosts. It is cumbersome and prone to errors (which can be hard to reverse!).
To be honest, since Zabbix is able to re-associate items on host level, I do not understand why it won't allow importing template overwriting existing items (instead of complaining they exist and fail). I do not understand how it can update some template items and complain about some existing. It is not logical.
I made a bug report but so far it did not get a lot of attention...
Thanks!Comment
-
Markku I take my word back.. this was maybe the best way even though it is cumbersome, but also not work very smoothly.
Because it ended up hosts having triggers which were left over from previous template and same but different triggers appeared from new templates.
So I ended up needing to clean things up.
In one case, it still complained some graph item exists but it is not same. So I could not assign template back to hosts after updating.
I hope Zabbix developers are watching the forum...
Comment
-
I'm only adding another post to hopefully bring some attention to the template management mess. I love Zabbix and think it's the greatest but in all fairness, the template management aspect of the platform desperately needs attention. I don't understand why so many frivolous things get a lot of attention but something that is core to the integrity of the Zabbix platform and plays such an important role has been ignored for years. Please Zabbix, do something about this.Comment
Comment