[ZBXNEXT-5228] Make template attributes optional Created: 2019 May 16  Updated: 2024 Apr 10  Resolved: 2019 Oct 28

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: API (A), Frontend (F), Templates (T)
Affects Version/s: None
Fix Version/s: 4.4.0rc1, 4.4 (plan)

Type: Change Request Priority: Trivial
Reporter: Rostislav Palivoda Assignee: Roberts Lataria (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Selection_564.png     PNG File Selection_566.png     PNG File Selection_567.png     PNG File Selection_569.png     PNG File Selection_571.png     GIF File http_export.gif     XML File zbx_export_hosts (18).xml     XML File zbx_export_hosts (35).xml     XML File zbx_export_hosts (80).xml     XML File zbx_export_hosts from 4.2 (3).xml     XML File zbx_export_templates (1).xml     XML File zbx_export_templates (29).xml     XML File zbx_export_templates (3).xml     XML File zbx_export_templates (4).xml     XML File zbx_export_templates (7).xml     XML File zbx_export_templates (70).xml     XML File zbx_export_templates (71).xml    
Issue Links:
Causes
causes ZBXNEXT-5709 Adopt Host API to export XML data str... Open
causes ZBX-17165 Incorrect validation rules for 4.4 XM... Closed
Duplicate
is duplicated by ZBXNEXT-2809 don't export excess information in xml Closed
Sub-task
part of ZBXNEXT-5372 Support of XML import/export for medi... Closed
Team: Team D
Team: Team D
Sprint: Sprint 56 (Sep 2019), Sprint 55 (Aug 2019), Sprint 52 (May 2019), Sprint 53 (Jun 2019), Sprint 54 (Jul 2019), Sprint 57 (Oct 2019)
Story Points: 7

 Description   

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:

  1. We must limit number of mandatory attributes to absolute minimum
    1. For example, in case of items: name, key
  2. Non-mandatory attributes must have safe default values:
    1. Default values must match defaults from UI whenever possible
      1. If a default value is not good for some reason, it must be adjusted also in UI, API and database schema
    2. For example, some defaults for items: item type: Zabbix agent; value type: Unsigned; delay: 1m (should be modified); status: Enabled
  3. All numeric constants must get appropriate human readable non-translatable alternatives, no numeric constants will be supported anymore
    1. 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.
      1. For example, item type: "SNMPv1", value type: "FLOAT"
  1. API calls
    1. configuration.import will be updated to support new logic (new defaults, human readable constants, new set of mandatory fields) 
    2. configuration.export must not export non-relevant attributes or attributes having default values
      1. Values must be in human readable form whenever possible
  2. When importing an existing host or template, Zabbix will also overwrite missing attributes taking into account default values
  3. All exported objects must be ordered by sort fields first and then mandatory fields
    1. Sort fields for all objects must be reviewed, for example:
      1. Item: name + key
      2. Trigger: name + expression

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

  1. I want to have simple human readable templates in XML format

Decisions made

  1. Existing attribute names will not be changed


 Comments   
Comment by richlv [ 2019 May 16 ]

Mostly a duplicate of ZBXNEXT-2809.

Comment by Roberts Lataria (Inactive) [ 2019 Jul 12 ]

Resolved in development branch feature/ZBXNEXT-5228-4.3.

Comment by Roberts Lataria (Inactive) [ 2019 Oct 02 ]

Available in:

Comment by Alexander Vladishev [ 2019 Oct 28 ]

Updated documentation:

Generated at Sat Apr 20 13:37:33 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.