[ZBX-7102] Error creating host via API with method host.create if defined inventory properties Created: 2013 Oct 05  Updated: 2017 May 30  Resolved: 2015 Mar 30

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

Type: Incident report Priority: Major
Reporter: Vlad Vnukovsky Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: api
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

FreeBSD 9.1 amd64, Apache 2.2, PHP 5.4.19


Attachments: File tcpdump    
Issue Links:
Duplicate
is duplicated by ZBX-9093 Can't create host with inventory thro... Closed

 Description   

After send request for create host:

{
   "auth" : "cc707461f861680b371a61cc48a4ae6a",
   "params" : {
      "inventory" : {
         "notes" : "Host created via Zabbix API",
         "type" : "Test host type"
      },
      "inventory_mode" : "1",
      "interfaces" : {
         "dns" : "",
         "useip" : "1",
         "ip" : "192.168.0.86",
         "type" : "2",
         "port" : "161",
         "main" : "1"
      },
      "groups" : [
         {
            "groupid" : "6"
         },
         {
            "groupid" : "7"
         }
      ],
      "host" : "Test AP via API 1"
   },
   "jsonrpc" : "2.0",
   "id" : 0,
   "method" : "host.create"
}

I received response:

{"jsonrpc":"2.0","result":{"hostids":["10100"]},"id":0}

but host was not created. Next same requests finished without any differences, I received same hostids in result.

If I remove from the query section "inventory", the host is created successfully.



 Comments   
Comment by Vlad Vnukovsky [ 2013 Oct 07 ]

This is a tcp dump for Zabbix API session

Comment by Volker Fröhlich [ 2014 May 12 ]

Saw the same on 2.2.1. It's not about that particular inventory mode. The same happens with inventory mode 0 or just trying to set some inventory field.

Comment by Alexander Vladishev [ 2015 Mar 30 ]

Already fixed under ZBX-9093. I close the issue as duplicate.

Generated at Fri Apr 26 15:24:54 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.