Announcement

Collapse
No announcement yet.

Zabbix API and usermacro

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Zabbix API and usermacro

    Hello All,

    I am trying to obtain the value of a usermacro defined in a host or template with Zabbix 1.8.10. I am sending the following json command which specifies the macro using a filter:

    Code:
    {"auth":"ce1e2f5efef9d18abfdb128fbdd625b2","method":"usermacro.get","id":1,"params":{"filter":{"macro":"{$MACROTEST}"}},"jsonrpc":"2.0"}
    and I receive the response:

    Code:
    {"jsonrpc":"2.0","result":[{"hostmacroid":"4"}],"id":1}
    While the request and response seem valid, it is not the response I expected. The documentation indicates a number of items returned in the response, including the macro's associated value. Please see this reference.

    Is there a setting that I need to enable or some other change I need to make? Thanks for your help!

    #2
    I found the issue. I needed to indicate extended output in the parameters section of the request:

    Code:
    "output": "extend"
    Thanks.

    Comment

    Working...
    X