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

hostinterface.update method works faulty on same type interface "main" change

    XMLWordPrintable

    Details

    • Team:
      Team D
    • Sprint:
      Sprint 51 (Apr 2019)
    • Story Points:
      0.5

      Description

      How to reproduce:

      1. Create host with 2 same type interfaces. For example, Zabbix Agent

      {
          "jsonrpc": "2.0",
          "method": "hostinterface.get",
          "params": {
              "output": "extend",
              "hostids": "10319"
          },
          "auth": "4c039068a9b6986bb6e8a6bc1ed71ae9",
          "id": 1
      }
      
      {
          "jsonrpc": "2.0",
          "result": [
              {
                  "interfaceid": "64",
                  "hostid": "10319",
                  "main": "0",
                  "type": "1",
                  "useip": "1",
                  "ip": "127.0.0.1",
                  "dns": "",
                  "port": "10050",
                  "bulk": "1"
              },
              {
                  "interfaceid": "86",
                  "hostid": "10319",
                  "main": "1",
                  "type": "1",
                  "useip": "1",
                  "ip": "127.0.0.1",
                  "dns": "",
                  "port": "30051",
                  "bulk": "1"
              }
          ],
          "id": 1
      }
      

      2. Set to non-main interface main: 1 via the hostinterface.update method.

      {
          "jsonrpc": "2.0",
          "method": "hostinterface.update",
          "params": {
              "interfaceid": "64",
              "main": "1"
          },
          "auth": "4c039068a9b6986bb6e8a6bc1ed71ae9",
          "id": 1
      }
      
      {
          "jsonrpc": "2.0",
          "result": {
              "interfaceids": [
                  "64"
              ]
          },
          "id": 1
      }
      

      *Result: *
      1. There will be two interfaces with the "main": "1" parameter

      {
          "jsonrpc": "2.0",
          "result": [
              {
                  "interfaceid": "64",
                  "hostid": "10319",
                  "main": "1",
                  "type": "1",
                  "useip": "1",
                  "ip": "127.0.0.1",
                  "dns": "",
                  "port": "10050",
                  "bulk": "1"
              },
              {
                  "interfaceid": "86",
                  "hostid": "10319",
                  "main": "1",
                  "type": "1",
                  "useip": "1",
                  "ip": "127.0.0.1",
                  "dns": "",
                  "port": "30051",
                  "bulk": "1"
              }
          ],
          "id": 1
      }
      

      2. The host configuration page "breaks".

      Expected result:
      The hostinterface.update method must downgrade previous main(default) interface to non-default.

        Attachments

          Activity

            People

            Assignee:
            gcalenko Gregory Chalenko
            Reporter:
            aleksejs.petrovs Aleksejs Petrovs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: