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

Multiple problems with the host interface API

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • 2.1.0
    • API (A)

      There are several problems with the hostinterface API:

      1. It's possible to make multiple default interfaces of the same type on one host, when updating a single interface with hostinterface.update. Then the host configuration form doesn't work: javascript triggers an error: "Multiple default interfaces for same type."

      2. The "selectHosts" option returns an array of hosts, but an interface can belong to only one host. It should just return a single object. It also shouldn't support "count."

      3. hostinterface.massadd returns an incorrect result:

      {
          "jsonrpc": "2.0",
          "result": {
              "interfaceids": {
                  "interfaceids": ["32004"]
              }
          },
          "id": 38
      }
      

      4. Similar to 3., hostinterface.massremove returns a boolean value instead of IDs:

      {
          "jsonrpc": "2.0",
          "result": {
              "interfaceids": {
                  "interfaceids": true
              }
          },
          "id": 39
      }
      

      5. I couldn't get hostinterface.replacehostinterfaces to work at all. I tried calling it using the following request:

      {
          "hostid": "30037",
          "interfaces": {
              "dns": "",
              "ip": "127.0.0.2",
              "main": 1,
              "port": "10050",
              "type": 1,
              "useip": 1
          }
      }
      

      And received an error:

      SQL statement execution has failed "INSERT INTO interface (dns,ip,main,port,type,useip,hostid,interfaceid) VALUES ('','127.0.0.2','1','10050','1','1','30037','30075')".
      

      6. Since hostinterface.massadd, hostinterface.replacehostinterfaces and hostinterface.massremove do the same things as host.massadd, host.massupdate and host.massremove respectfully, they could be rewritten to just use the host API methods.

      7. The "groupids" parameter must be removed from the hostinterface.get parameters, but "selectHosts" and "selectItems" added.

            Unassigned Unassigned
            jelisejev Pavels Jelisejevs (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: