See www.zabbix.com for the official Zabbix site.
Ability to remove resources missing in XML file
A new option 'Delete missing' will make updating of existing hosts and templates much easier. Copying of a template from test to production is a typical use case.
Third column 'Delete missing' will be introduced in XML import screen. It will be unchecked by default and available for:
Template screens Applications Items Discovery rules Triggers Graphs
If the option is selected then objects missing in XML file will be removed from Zabbix database.
Enabling this option will delete only objects from the imported hosts. For example: if we have two hosts: H1 and H2 and a trigger that belongs to both hosts. When we export H1 and import it back using this option, only triggers on H1 will be removed. Even though the XML file contains a trigger from H2, its triggers will not be removed, since H2 itself is not present in the XML file.
Objects discovered by LLD rules will not be affected by this option.
If at least one of the checkboxes is enabled, a confirmation pop up will appear when clicking "Import" saying: "Delete all elements that are not present in the XML file?"
To avoid confusion caused by using the word "missing" in two columns, the "Add missing" column will be renamed to "Create new".
Missing objects will be deleted before any other objects are imported. Otherwise, the following situation might occur:
- We export a host with two items and a graph that uses these two items.
- We remove one of the items from the XML file and import it back with the "delete missing" checkbox checked for items. The XML is imported and the item is removed. Note, that the graph will be imported, but only with one item.
- We import the XML file again with the same parameters as in the previous step. Now it will fail because the graph references an item which does not exist.
Deleting objects before importing anything else will allow us to fail when other imported objects reference them.
To implement this functionality for applications, a new row will be added to the import form before the "Items" row: "Applications" with two checkboxes for creating and deleting applications. The create checkbox must be checked by default when importing templates and hosts.
A "deleteMissing" parameter will be added for the following configuration.import parameters: "templateScreens", "applications", "items", "discoveryRules", "triggers" and "graphs".
Delete all elements that are not present in the XML file?
- What's new in 2.4
- XML Import section
The option is introduced for template and host resources only. It's too dangerous to introduce it for hosts/templates and higher-level objects.
- added a confirmation message
- renamed "Remove if missing in XML" to "Delete missing" and "Add missing" to "Create new"
- add a new "Applications" row to the import form