jsonzabbix

JSON-over-HTTP LLD fails with name contains invalid character '{'


I'm trying to configure a simple Host LLD from JSON over HTTP source, like this one: https://pastebin.com/raw/YWWxGs7y

It uses Preprocessing step with JSONpath (I can test it with built-in testing tool) and 3 LLD-macros which are JSONPaths, too. I test them with output (Result) JSON from built-in testing tool and https://jsonpath.com/

My LLD fails with multiple errors:

Cannot create host "{#LOCATION_ID}": name contains invalid character '{'.
Cannot create host "{#LOCATION_ID}": name contains invalid character '{'.
Cannot create host "{#LOCATION_ID}": name contains invalid character '{'.
Cannot create host "{#LOCATION_ID}": name contains invalid character '{'.​
...

I guess that LLD-Macro's value remains empty, but I have no idea how to check and solve this

My Template in Yaml https://pastebin.com/raw/bBHuJgEz

PS reposted from zabbix forum


Solution

  • I believe the correct macro could be:

              lld_macro_paths:
                -
                  lld_macro: '{#LOCATION_ID}'
                  path: '$.id'
                -
                  lld_macro: '{#LOCATION_NAME}'
                  path: '$.name'
                -
                  lld_macro: '{#LOCATION_TYPE}'
                  path: '$.type'