Ad Widget

Collapse

Web Monitoring: Pass body repsonse of first step to the second step?

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • davesynx
    Junior Member
    • Jul 2024
    • 2

    #1

    Web Monitoring: Pass body repsonse of first step to the second step?

    Hello,

    I started using Zabbix recently and I am setting up the Monitoring System for our internal systems and a web site.

    What I did set up is to monitor if the web site is loading and if a simple Login works. So far so good.
    Now I want to test a function on the website, for which a json web token is needed. I can generate the token and i can (if i have a token) test the function succesfully.

    The problem is, the token only works for 24h until a new one is needed. To automate the process i thought i could create a token in the first step of the scenario and use that token in the second step to test the function.

    My first step is a simple GET request, requesting for a token with the correct API Key, User ID and password (that works perfectly fine)

    The second is a POST request with a small json code, which tests the function (wich also works fine with a token i manually generated from our system).

    I want to put the body response of the first step, which is the token, into {$jwt} macro to use it inside the code of the next step.

    Until now everything works fine but I somehow can't figure that one thing out.

    Any help is greatly appreciated. Thank you.
  • Answer selected by Markku at 11-07-2024, 11:08.
    davesynx
    Junior Member
    • Jul 2024
    • 2

    After a lot of research and another talk to our inhouse developer I got it working with regex.

    {$jwt} = regex:^(.*)$ was the solution in my case.

    Comment

    • davesynx
      Junior Member
      • Jul 2024
      • 2

      #2
      After a lot of research and another talk to our inhouse developer I got it working with regex.

      {$jwt} = regex:^(.*)$ was the solution in my case.

      Comment

      Working...