Ad Widget

Collapse

Zabbix life scenario

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mattjan
    Junior Member
    • Apr 2021
    • 19

    #1

    Zabbix life scenario

    Hi,
    I need help with real life scenario, I'm using Zabbix 5 and stumble this issue for days:

    Respond from website: <input type="hidden" name="__VIEW_ID " id="__VIEW_ID" value="5742566d6a3566646930676a346573626c746b696b3 56b633a" />

    I could do this successfully using Postman:
    1. Browse the website, copy the value of: __VIEW_ID
    2. I could login using this setup:
    in the body:
    __VIEW_ID = (get it from the first step)
    __Username =testuser
    __Password =testpassword
    3. verify that I could find word "success"

    Using real life scenario with follow redirect is checked
    • Post fields same as above but __VIEW_ID is {VIEWSTATE}
    • {VIEWSTATE} ->regex:name="__VIEWID" id="__VIEW_ID" value="([a-zA-Z0-9]{50})" -> I got response 200 but Required pattern "success" was not found
    • Since I'm not sure what Zabbix send the variable, I changed {VIEWSTATE} to regex:"((?<=value\=")[a-zA-Z0-9]{50})" but I get the same result.

    I have tested the second REGEX against the whole response and verified that it capture only the value of __VIEW_ID.

    Any idea how to debug or solve this?

    Thanks
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    In your regex you have
    Code:
    name="__VIEWID
    while it should be
    Code:
    name="__VIEW_ID

    Comment

    • mattjan
      Junior Member
      • Apr 2021
      • 19

      #3
      Sorry it was a typo.
      I just want to clarify
      If the variable {VIEWSTATE} is regex:name="__VIEW_ID" id="__VIEW_ID" value="([a-zA-Z0-9]{50})" and Post field __VIEW_ID = {VIEWSTATE}, what will zabbix send the value of __VIEW_ID? Is it the whole variable or just value inside () ?

      I also tried to change Required pattern on step 2 to "AuthSession" but failed, do you think i should capture AuthSession and assign to variable?

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        I just want to clarify
        If the variable {VIEWSTATE} is regex:name="__VIEW_ID" id="__VIEW_ID" value="([a-zA-Z0-9]{50})" and Post field __VIEW_ID = {VIEWSTATE}, what will zabbix send the value of __VIEW_ID? Is it the whole variable or just value inside () ?
        It will assign the value of ([a-zA-Z0-9]{50}) to {VIEWSTATE}, so only the value of subgroup (what's within the brackets).
        I also tried to change Required pattern on step 2 to "AuthSession" but failed, do you think i should capture AuthSession and assign to variable?
        If I understood you correctly, you can capture as many variables as you want and use each in any step after the one where it was captured.

        Comment

        • mattjan
          Junior Member
          • Apr 2021
          • 19

          #5
          Thanks Dimir,

          Finally I make it.
          The one that make me confuse is the response, on Chrome when click login I get response 302 (found) and then I could find "success" in fqdn/verified, with Postman I never get response 302, only 200 but I could find "success", on Zabbix same thing only 200 but couldn't find "success" until I removed the required pattern from 2nd step, created 3rd step with url fqdn/verified and put the required pattern over there.

          Comment

          Working...