-
Change Request
-
Resolution: Fixed
-
Trivial
-
None
-
None
-
Sprint 56 (Sep 2019), Sprint 55 (Aug 2019), Sprint 52 (May 2019), Sprint 53 (Jun 2019), Sprint 54 (Jul 2019), Sprint 57 (Oct 2019)
-
7
Summary
Current implementation of XML import requires existence of all XML attributes even if an attribute supposed to be empty or not relevant. It makes templates in XML format heavy and hardly readable.
Proposed changes will enable producing of small and simple export files by having only very limited number of mandatory attributes.
Zabbix Acceptance
All host and template XML attributes must be reviewed:
- We must limit number of mandatory attributes to absolute minimum
- For example, in case of items: name, key
- Non-mandatory attributes must have safe default values:
- Default values must match defaults from UI whenever possible
- If a default value is not good for some reason, it must be adjusted also in UI, API and database schema
- For example, some defaults for items: item type: Zabbix agent; value type: Unsigned; delay: 1m (should be modified); status: Enabled
- Default values must match defaults from UI whenever possible
- All numeric constants must get appropriate human readable non-translatable alternatives, no numeric constants will be supported anymore
- Human readable strings should be as close to as possible to constants already used in Zabbix code, case sensitive. Some constants should be renamed in Zabbix code to make them easier to understand.
-
-
- For example, item type: "SNMPv1", value type: "FLOAT"
-
- API calls
- configuration.import will be updated to support new logic (new defaults, human readable constants, new set of mandatory fields)
- configuration.export must not export non-relevant attributes or attributes having default values
- Values must be in human readable form whenever possible
- When importing an existing host or template, Zabbix will also overwrite missing attributes taking into account default values
- All exported objects must be ordered by sort fields first and then mandatory fields
- Sort fields for all objects must be reviewed, for example:
- Item: name + key
- Trigger: name + expression
- Sort fields for all objects must be reviewed, for example:
A few examples
Item definition in XML
<item>
<name>Modification time of /etc/passwd</name>
<key>vfs.file.time[/etc/passwd]</key>
<type>ZABBIX_ACTIVE</type>
</item>
Trigger definition in XML
<trigger>
<name>Some problem</name>
<expression>{Template:vfs.file.time[/etc/passwd].fuzzytime(1h)}=1</expression>
<priority>HIGH</priority>
</trigger>
Business Use Cases
- I want to have simple human readable templates in XML format
Decisions made
- Existing attribute names will not be changed
- causes
-
ZBXNEXT-5709 Adopt Host API to export XML data structure.
- Open
-
ZBX-17165 Incorrect validation rules for 4.4 XML import
- Closed
- is duplicated by
-
ZBXNEXT-2809 don't export excess information in xml
- Closed
- part of
-
ZBXNEXT-5372 Support of XML import/export for media types
- Closed