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

API host.update method fails if interfaces specified and templates are linked

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • 3.4.6
    • API (A)
    • n/a
    • Sprint 30, Sprint 31, Sprint 32
    • 0

      Step 1) Create a host (manually or with API) with standard agent interface (type: 1, main: 1) and assign a template that has Zabbix Agent items so that interface is in use.

      Step 2) Call the API method host.update and populate 'interfaces' in the call. This can be the exact same interface information. The call will fail with a message akin to:

      {
        "code": -32602,
        "message": "Invalid params.",
        "data": "Interface is linked to item \"Total memory\" on \"example.com\"."
      }

      The wisdom of the crowds suggests the method is trying to delete the interface and readd it. Because the interface is in use it can't be deleted and the update fails. (See the write-up at https://github.com/express42/zabbixapi/issues/4 which includes the kind of workaround that has to be employed .)

      This has apparently been around for a long time and likely impacts most active versions.

      Marked this as Major because it requires a lot of additional code to work around what seems to be a design defect in the API.

            Unassigned Unassigned
            LarryDorman Larry Dorman
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: