[ZBX-3675] Item created by API in template has a NULL in the "interfaceid" in the real inherited host Created: 2011 Mar 31  Updated: 2017 May 30  Resolved: 2011 Nov 01

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 1.9.3 (alpha)
Fix Version/s: 1.9.8 (beta)

Type: Incident report Priority: Blocker
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: api
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

latest trunk rev 18820
Host already linked to template before creating item by API.



 Description   

as result - items in the real host does not start to monitor because it has no interface in the DB.
Host availability is marked as "Invalid port number []"

Item created by zabcon.
Request:
raw json {"auth":"$auth","method":"item.create","id":163,"params":

{"hostid":10098,"type":0,"value_type":3,"delay":60,"history":10,"description":"Test key created by API","key_":"test.echo[my_test_text]"}

,"jsonrpc":"2.0"}
Answer:
{:class=>:raw, :result=>{"itemids"=>["25447"]}}

DB (item in the host):
mysql> SELECT `key_`, `description`, `interfaceid` FROM `items` WHERE `itemid` =25449;
-----------------------------------------------------------

key_ description interfaceid

-----------------------------------------------------------

test.echo[my_test_text] Test key created by API NULL

-----------------------------------------------------------
1 row in set (0,00 sec)



 Comments   
Comment by Oleksii Zagorskyi [ 2011 Jun 04 ]

<[01.06.2011 15:44] * Richlv * zalex, do you still see https://support.zabbix.com/browse/ZBX-3675 ?>

Problem is still reproducible in the current trunk rev 20046.

Request:
raw json {"auth":"$auth","method":"item.create","id":163,"params":

{"hostid":10098,"type":0,"value_type":3,"delay":60,"history":10,"name":"Test key created by API","key_":"test.echo[my_test_text]"}

,"jsonrpc":"2.0"}

Answer:
{:class=>:raw, :result=>{"itemids"=>["25758"]}}

DB (item in the host):
mysql> SELECT `hostid`, `key_`, `name`, `interfaceid` FROM `items` WHERE `itemid` =25759;
-----------------------------------------------------------------+

hostid key_ name interfaceid

-----------------------------------------------------------------+

10099 test.echo[my_test_text] Test key created by API NULL

-----------------------------------------------------------------+
1 row in set (0.00 sec)

Comment by Alexey Fukalov [ 2011 Nov 01 ]

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

Comment by Alexey Fukalov [ 2011 Nov 04 ]

svn://svn.zabbix.com/trunk 22961

Generated at Sat Apr 20 07:18:22 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.