Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7102

Error creating host via API with method host.create if defined inventory properties

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.8
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:
    • Environment:
      FreeBSD 9.1 amd64, Apache 2.2, PHP 5.4.19

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                vvlad Vlad Vnukovsky
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: