[ZBX-3684] excessive data returned to template.get Created: 2011 Apr 01  Updated: 2017 May 30  Resolved: 2012 Nov 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Incident report Priority: Major
Reporter: richlv Assignee: Oleg Egorov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

1.8.5rc1



 Description   

template.get returns excessive and confusing output of duplicate hostid+templateid values.

host.get request :

{"auth":"4e1863827e2068815f6bdcfbea290bb2","method":"host.get","id":19,"params":{},"jsonrpc":"2.0"}

{"jsonrpc":"2.0","result":[

{"hostid":"10017"}

,

{"hostid":"10054"}

,

{"hostid":"10055"}

,

{"hostid":"10056"}

,

{"hostid":"10051"}

],"id":19}

template.get request :

{"auth":"4e1863827e2068815f6bdcfbea290bb2","method":"template.get","id":20,"params":{},"jsonrpc":"2.0"}

{"jsonrpc":"2.0","result":[

{"hostid":"10001","templateid":"10001"}

,

{"hostid":"10002","templateid":"10002"}

,

{"hostid":"10003","templateid":"10003"}

,... (trimmed)

should not.



 Comments   
Comment by Alexander Vladishev [ 2012 Sep 19 ]

Stay reproducible in branches/2.0 r30280 (pre-2.0.3).

Comment by Alexey Fukalov [ 2012 Sep 24 ]

dev branch: svn://svn.zabbix.com/branches/dev/ZBX-3684

Comment by Pavels Jelisejevs (Inactive) [ 2012 Sep 25 ]

(1) Error when opening the link template pop up:

Undefined index: hostid [popup.php:643]

Vedmak RESOLVED

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Sep 26 ]

TESTED.

Comment by Alexey Fukalov [ 2012 Sep 26 ]

Fixed in pre-2.1.0 r30352

Comment by richlv [ 2012 Sep 26 ]

(2) docs

Vedmak Where should i add docs about this change?

<richlv> http://www.zabbix.com/documentation/2.0/manual/appendix/api/changes_2.2 ?
er, fail. ignore the above
http://www.zabbix.com/documentation/2.2/manual/appendix/api/changes_2.0_-_2.2

Vedmak RESOLVED

<richlv> note that, as discussed, we should also have this documented in appropriate template.get page for 2.2. whether we copy whole tree or create these pages one by one, that's for you all to decide

Vedmak Change log should be enough, 2.2 will have new docs with correct return parameters.

<richlv> ok, let's hope the docs will be there - CLOSED

Comment by Alexander Vladishev [ 2012 Nov 16 ]

(3) import of the 1.8 templates is broken after the fix (the error occurs when the template already exists)

Undefined index: hostid [include/classes/import/CXmlImport18.php:1099]

oleg.egorov FIXED IN svn://svn.zabbix.com/branches/dev/ZBX-3684-trunk r31551

RESOLVED

Eduards CLOSED

Comment by Oleg Egorov (Inactive) [ 2012 Nov 16 ]

ZBX-5855 will be fixed in this issue

FIXED IN svn://svn.zabbix.com/branches/dev/ZBX-3684-trunk r31551

RESOLVED

Eduards CLOSED

Comment by Eduards Samersovs (Inactive) [ 2012 Nov 22 ]

Tested!

Comment by Oleg Egorov (Inactive) [ 2012 Nov 22 ]

FIXED in 2.0.4 r31620, 2.1.0 r31621
CLOSED

Generated at Thu Apr 25 01:47:12 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.