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

Incorrect documentation for usermacro.get method

XMLWordPrintable

    • Sprint 28
    • 0

      The documentation for the usermacro.get method is slightly incorrect. It states that a "templateids" parameter can be passed, but whenever I use it, the call returns nothing. The hostid "10777" is a template.

      call: {"jsonrpc":"2.0","method":"usermacro.get","params":{"filter":{"macro":"{$100SEC_MINIMUM}"},"output":"extend","templateids":10777},"auth":"4260a3a273a0360fe31bac40d8133900","id":"13914696940139"}
      result:  {"jsonrpc":"2.0","result":[],"id":"13914696940139"}

      If I change "templateids" to "hostids", here's what happens:

      call: {"jsonrpc":"2.0","method":"usermacro.get","params":{"filter":{"macro":"{$100SEC_MINIMUM}"},"output":"extend","hostids":10777},"auth":"0682ec513cdb802e7809114ea450cc5f","id":"13914697413789"}
      result: {"jsonrpc":"2.0","result":[{"hosts":[{"hostid":"10777"}],"hostmacroid":"927","hostid":"10777","macro":"{$100SEC_MINIMUM}","value":"20"}],"id":"13914697413789"}

            natalja.cernohajeva Natalja Cernohajeva (Inactive)
            heaje Corey Shaw
            Team B
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: