ZABBIX Forums  
  #1  
Old 05-05-2012, 01:53
ronfulkerson ronfulkerson is offline
Junior Member
 
Join Date: May 2012
Posts: 5
Default 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!
Reply With Quote
  #2  
Old 07-05-2012, 20:45
ronfulkerson ronfulkerson is offline
Junior Member
 
Join Date: May 2012
Posts: 5
Default

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

Code:
"output": "extend"
Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:28.