I'm trying to use Zabbix (5.0) to capture the response from a REST API.
If I paste the following into a webbrowser (or wget / curl etc)
http://{username}:{password}@10.1.2.3:8443/api/metadata/
I get the response I expect:
{"items":[{"name":"this_is_my_name"}]}
I am trying to capture the value of name
into zabbix.
I have set up a web scenario
against my template, and in the steps
section I have:
Name: test_name
URL: http://{username}:{password}@10.1.2.3:8443/api/metadata/
Raw Data
Retrieve Mode: Body
Timeout: 15s
Required String: $.items:["name"]
Required Status Code: 200
Then looking at the latest data for it I see I have a response conde of 200
, but an error of:
required pattern "$.items:["name"]" was not found on http://{username}:{password}@10.1.2.3:8443/api/metadata/
I have tried all manner of variations in the Required String field, and always the same result.
Have I missed something, or misunderstood something. Does Zabbix even do what I am trying to do?