Ad Widget

Collapse

Web scenario, required string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kirin2
    Junior Member
    • Jul 2018
    • 28

    #1

    Web scenario, required string

    Hi, guys!
    I'd like to monitor if the string is present one the particular web page. I use Web scenario, but all what I'm trying to monitor - all aren't present, so I'm getting error: "Step "Main" [1 of 1] failed: required pattern [OK] was not found on URL".

    Tried to put in Required string part of HTML code, but error the same.

    What am I doing wrong?

    Zabbix 3.4.9.


    Thank you!
  • androponia
    Junior Member
    • Jan 2019
    • 18

    #2
    Hi, can you post the example you are using?

    You can use POSTMAN to check if the string you want is inside the html, and at frist, try with some words, and then if it works try a sentence.

    Comment

    • Kirin2
      Junior Member
      • Jul 2018
      • 28

      #3
      androponia , I've used one word to find, I clicked on web page "Inspect" and then found word which I need. It's looks like:
      Below screenshots of my configuration:
      In the Required string I've tried to find, for example word "[OK]", so I've inputted: <a href="http://google.com/"><span style="color: red">[OK]</span></a>
      Click image for larger version

Name:	Scenario.png
Views:	6701
Size:	35.7 KB
ID:	372827
      Click image for larger version

Name:	Step.png
Views:	6660
Size:	35.0 KB
ID:	372826

      Comment

      • androponia
        Junior Member
        • Jan 2019
        • 18

        #4
        It seems that you define variables instead of POST variables, when you try to log in to a page you must pass or query fields, or POST variables.

        like: the image below:

        Click image for larger version

Name:	web.PNG
Views:	6355
Size:	10.0 KB
ID:	372868

        Comment

        • Kirin2
          Junior Member
          • Jul 2018
          • 28

          #5
          I've updated my scenario. Now it has 4 steps, as here https://www.zabbix.com/documentation...toring/example
          So, I have:
          -Log In (and it seems okay)
          -Check Log In(Here is problem)
          -Log out
          -Check Log out

          Scenario:
          Click image for larger version

Name:	Scenario.png
Views:	6524
Size:	27.3 KB
ID:	372939

          Log In
          Click image for larger version

Name:	login.png
Views:	6570
Size:	33.3 KB
ID:	372941
          Check Log In:
          Click image for larger version

Name:	Checklogin.png
Views:	6476
Size:	31.5 KB
ID:	372942

          Output always the same:
          Click image for larger version

Name:	Output.png
Views:	6625
Size:	16.5 KB
ID:	372943
          Attached Files

          Comment

          • Kirin2
            Junior Member
            • Jul 2018
            • 28

            #6
            Done it. My fault was in Authentication
            But I have one more question.
            How to configure sid value? I want to my user reconnect every time, but not open a new session

            Comment

            • androponia
              Junior Member
              • Jan 2019
              • 18

              #7
              You can try defining in query fields, but i havent try it, if it works, post it to others!

              Comment

              Working...