southbridgeio / zabbix-review-export-import

Clone of zabbix-review-export with added import object(s) feature
https://gitlab.com/devopshq/zabbix-review-export
50 stars 30 forks source link

Technical Discussion: Any chance to export the internal Object-IDs? #7

Open gjaekel opened 3 years ago

gjaekel commented 3 years ago

Dear Evgenii, you probably well know, that all the Zabbix objects internal have an ID as the primary key. That allow -- as one of the top features -- to rename most of the objects without breaking any relations.

Unfortunately, this awesome feature is "lost" at the export/import interface: Here, the primary key used for relations is the name of the object. Right in the case of tracing changes on an instance or promoting it into a stage workflow, this is big cutback.

Do you see any chance to get and preserve the internal object IDs to the output? On may add it to the output as an XML/YAML/JSON-comment. This will allow and ease the detection and handling of name changes by external tools.

BTW: I already wrote some tools generating "Zabbix XML" and found: The Zabbbix XML-parser have a bug concerning parsing comments: One get a false positive parsing error on using any sequence of more than two - inside <!-- and -->.

evgkrsk commented 3 years ago

As you can clearly see in source code, there is MUCH work to CLEAN zabbix api responses from object ids. And such ids was a big headache (as far as I remember 2 years after writing).

I don't have plans to writing code to preserve IDs, but definitely, PRs are welcome.

gjaekel commented 3 years ago

@evgkrsk We're had have using Zabbix-2.6 and now Zabbix-4.4. I also spend many time in the problem of internal used ID that get lost on (XML) output because this uses the display name. And I found no solution, too.

We want to use your tool to transport changes from stage to stage. The best I managed so far is to export and backup the files by stage and compare the changes. Your YAML export will ease the diff very much. The changes will be cherry-picked and moved to the next stage, then. Thank you for your work!!!