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

API method "usermacro.updateglobal" doesn't work and returns wrong error description using old method syntax

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • 1.9.9 (beta)
    • API (A)
    • None
    • latest trunk r25374

          • Related only to Zabbix 2.0 API ***

      (1) Correct 2.0 method syntax doesn't work:

      Request:
      {"jsonrpc":"2.0","method":"usermacro.updateglobal","params":[

      {"globalmacroid":"8","value":"192"}

      ],"id":0,"auth":"c6f72a1a2ee604002b6bd72b8586335a"}
      Response:
      {
      "jsonrpc":"2.0",
      "error":

      { "code":-32602, "message":"Invalid params.", "data":"Wrong macro \"\"." }

      ,
      "id":0
      }

      (2) Starting from Zabbix 2.0 the method "usermacro.updateglobal" is supporting ID(s) as a parameter.
      http://www.zabbix.com/documentation/2.0/manual/appendix/api/usermacro/updateglobal

      Zabbix 1.8 supported only macro name(s) as a parameter.
      http://www.zabbix.com/documentation/1.8/api/usermacro/updateglobal

      If an user will use old 1.8 method with 2.0 GUI then error "Macro \"{$MACRO1}\" already exists." will be enough incorrect and can confuse.
      This error message should be changed to something: "Array of macro IDs missing" or so.

      An example using trunk r25374 API:
      Request:
      {"jsonrpc":"2.0","method":"usermacro.updateglobal","params":{"macro":"{$MACRO1}","value":"192.168.0.1"},"id":0,"auth":"c6f72a1a2ee604002b6bd72b8586335a"}
      Response:
      {
      "jsonrpc":"2.0",
      "error":{
      "code":-32602,
      "message":"Invalid params.",
      "data":"Macro \"{$MACRO1}\" already exists."
      },
      "id":0
      }

            Unassigned Unassigned
            zalex_ua Oleksii Zagorskyi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: