[ZBXNEXT-5433] Include host name into real-time export files Created: 2019 Sep 16  Updated: 2024 Apr 10  Resolved: 2019 Oct 16

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: None
Fix Version/s: 4.4.0rc1, 4.4 (plan)

Type: Change Request Priority: Trivial
Reporter: Aleksandrs Larionovs (Inactive) Assignee: Andrejs Kozlovs
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Sub-task
depends on ZBXNEXT-4831 Real-time export protocol missing types Closed
Team: Team A
Sprint: Sprint 56 (Sep 2019), Sprint 57 (Oct 2019)
Story Points: 0.25

 Description   

Include host name into real-time export files (now only visible host name is there)



 Comments   
Comment by Andrejs Kozlovs [ 2019 Sep 17 ]

Currently real-time export JSON files for events items and trends include information about host (or hosts) visible name. It is proposed to add host name too.
For this purposes old JSON tag "host" will be used. It is proposed to use JSON object consisting from visible and technical name of the host under this tag.

{
	"host": {
		"host":"My host name",
		"name":"My visible name"
	},
	"groups": ["Zabbix servers"],
	"applications": ["Zabbix server"],
	"itemid": 23662,
	"name": "Zabbix value cache operating mode",
	"clock": 1568788342,
	"ns": 272565946,
	"value": 0
}

For events, where array of hosts can be used proposed to use old tag "hosts" with array of JSON objects consisting from visible and technical name of the hosts

{
	"clock": 1568709760,
	"ns": 579504018,
	"value": 1,
	"eventid": 27,
	"name": "Trigger name",
	"hosts": [{
			"host": "My host name 1",
			"name": "My visible name 1"
		},
		{
			"host": "My host name 2",
			"name": "My visible name 2"
		}
	],
	"groups": ["Zabbix servers"],
	"tags": []
}

Server changes

  • function DCexport_history - add json object with ZBX_PROTO_TAG_HOST with item->host.name and item->host.host instead of string with the same tag
  • function DCexport_trends - add json object with ZBX_PROTO_TAG_HOST with item->host.name and item->host.host instead of string with the same tag
  • function zbx_export_events - add json object with host->host and host->name instead of string into array with tag ZBX_PROTO_TAG_HOSTS
  • patch from ZBXNEXT-4831 should be applied

Documentation changes

  • What's new
  • Real-time export protocol must be extended with new fields
  • Upgrade notes

 

Comment by Glebs Ivanovskis [ 2019 Sep 23 ]

Dear palivoda, is it an invitation to comment?

<palivoda>: Feel free.

Comment by Glebs Ivanovskis [ 2019 Sep 24 ]

I was asking this in PR, but the answer wasn't very optimistic. It is proposed above to change types of existing keys "host" and "hosts" from string and array of strings to object and array of objects. This will very likely break existing integrations (if there are any), existing user code will not be able to find host names in the same places. And unlike ZBXNEXT-5416, no one forces Zabbix to do this breaking change. Why can't you just leave existing keys alone and introduce new ones ("Hosts" or "hosts+" or whatever) with extra information? You can declare old keys deprecated and remove them in the next major release, but this will at least give users some time to adapt.

Comment by Andrejs Kozlovs [ 2019 Oct 01 ]

Fixed in:

  • 4.4.0rc1 (master) 64d5130f51e
Comment by Alexander Vladishev [ 2019 Oct 16 ]

Updated documentation:

Generated at Tue Apr 23 16:18:29 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.