Ad Widget

Collapse

Required string error in web scenario

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarcoBart
    Junior Member
    • Jan 2019
    • 4

    #1

    Required string error in web scenario

    Hi everybody!
    I have some problem with Web scenario to monitor my web site. I need to verify login was successfull, so I made 4 steps:
    1. open login page
    2. login with my credential
    3. check if login was successfull
    4- logout

    In step 1 I search string in my page, using "Required String" function and user macro to define my string, but when run the test i get the error
    Step "Home" [1 of 4] failed: required pattern "Utente:" was not found on http://xxx.yyy.ttt.it/lw/default.php
    The second image is my web scenario definition.

    Please help me to resolv this problem.
    My zabbix version is 3.4
    Thanks
    Last edited by MarcoBart; 11-01-2019, 13:05.
  • aigars.kadikis
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2018
    • 208

    #2
    You can try at first from command line from Zabbix server (or proxy) using "curl" utility. At first, check if the curl prints any useful HTML data:

    Code:
    curl http://xxx.yyy.ttt.it/lw/default.php
    Then if the normal content has been received try to search the keyword using grep:
    Code:
    curl http://xxx.yyy.ttt.it/lw/default.php | grep "some keyword"

    Comment

    • MarcoBart
      Junior Member
      • Jan 2019
      • 4

      #3
      Hi aigars,
      I forgot to write that my zabbix server is behind a proxy to navigate, so I configured my proxy with user authencation.
      I try with curl with this command:
      curl -U 'domain\myuser'assword -x myproxy:8080 http://xxx.yyy.ttt.it/lw/default.php/ -v
      * About to connect() to proxy myproxy port 8080 (#0)
      * Trying myproxy...
      * Connected to myproxy (myproxy) port 8080 (#0)
      * Proxy auth using Basic with user 'domain\myuser'
      > GET http://xxx.yyy.ttt.it/lw/default.php/ HTTP/1.1
      > Proxy-Authorization: Basic c2VkYVxwcm94eXVzZXJsaW51eE9TOlMzZGExMjM0
      > User-Agent: curl/7.29.0
      > Host: xxx.yyy.ttt.it
      > Accept: */*
      > Proxy-Connection: Keep-Alive
      >
      < HTTP/1.1 200 OK
      < Via: 1.1 VMTMG
      < Connection: close
      * HTTP/1.1 proxy connection set close!
      < Proxy-Connection: close
      < Expires: Thu, 19 Nov 1981 08:52:00 GMT
      < Date: Fri, 11 Jan 2019 12:03:28 GMT
      < Content-type: text/html
      < Server: Microsoft-IIS/6.0
      < X-Powered-By: ASP.NET
      < X-Powered-By: PHP/5.2.17
      < Set-Cookie: PHPSESSID=43fcno37ugikdcf16ccd3ss425; path=/
      < Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
      < Pragma: no-cache
      < Refresh: 0; URL=http://xxx.yyy.ttt.it/lw/
      <
      * Closing connection 0

      but I don't see the content of my web page

      Comment

      • zux
        Member
        • Sep 2018
        • 93

        #4
        Originally posted by MarcoBart

        but I don't see the content of my web page
        This is probably the reason Zabbix doesn't find the string too....

        Comment

        Working...