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

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.0.8
    • API (A)
    • FreeBSD 9.1 amd64, Apache 2.2, PHP 5.4.19

      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.

        1. tcpdump
          119 kB
          Vlad Vnukovsky

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

              Created:
              Updated:
              Resolved: