Ad Widget

Collapse

Help with API macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zumi_fi
    Junior Member
    • Sep 2018
    • 10

    #1

    Help with API macros

    Hello!

    I wrote a script that creates a new host in Zabbix.
    Everything works as it should, but when I add macro creation to the API it fails.

    The script is written in bash and the macro creation looks like this:
    Code:
    \"macros\": [{\"macro\": \"{\$TEST}\",\"value\": \"12345\"}]
    The output looks like this:
    Code:
    "message":"Invalid params.",
    "data":"Invalid macro \"{}\": incorrect syntax near \"}\"."
    if I remove the dollar sign, the output looks like:
    Code:
    "message":"Invalid params.",
    "data":"Invalid macro \"{TEST}\": incorrect syntax near \"TEST}\"."
    What is happening? Does anyone know?

Working...