Ad Widget

Collapse

Zabbix WebMonitoring and JSON

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stairs
    Junior Member
    • Jul 2018
    • 2

    #1

    Zabbix WebMonitoring and JSON

    Hello, I am a noob with Zabbix. I am setting up some web scenarios in Zabbix 3.4 to test a rest based application workflow with Zabbix. The responses are in JSON format and I am trying to form a regex that will extract a value an initial login

    I am getting an error in the zabbix console from my parse


    Error: error in step variables "{token}=regex:"access_token": "([0-9a-z-])"": cannot extract the value of "{token}" from response

    A typical response is


    {
    "access_token": "576fb0e1-0d99-4f7a-a1d7-d11d35aXXXX",
    "token_type": "Bearer",
    "expires_in": 3214,
    "refresh_token": "9a537f10-e2cb-476a-a296-f2fa885XXXX",
    }

    I am trying to debug this error but having problems. Is there a good website to validate my regex? Can we increase the logging in zabbix around web scenario to see what is happening or does any one have suggestion on the regex.

    Any help would be greatly appreciated.

    Thank you in advance
  • stairs
    Junior Member
    • Jul 2018
    • 2

    #2
    Replying to my own question. I have found how to get the response of a web scenario into the logs so can troubleshoot the regex. If I increase the logging level to 6. This will write the output. In my case I didn't have a space in the response coming back in the JSON so removed that from the regex.

    Comment

    Working...