Ad Widget

Collapse

Web monitoring configuration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sheh1000
    Junior Member
    • May 2015
    • 3

    #1

    Web monitoring configuration

    Hi,

    I am trying to parse a POST response to get a session ID but getting the error:

    Code:
    Step "Logging in" [2 of 3] failed: error in step variables "{bw_id}=regex:top.name='([0-9a-z]{32})'": cannot extract the value of "{bw_id}" from response
    I am 100% sure that regular expression is OK. It is defined on Step coniguraion screen as:

    {bw_id}=regex:top.name='([0-9a-z]{32})'
    I suppose the issue is related to parsing a response in a raw format:

    Request
    Code:
    POST http://a.x.x.x:8080/servlet/Turbine/action/pcp.PLoginHandler/event1234submit/doLogin/frm/single/lang/en_US/ HTTP/1.1
    Host: a.x.x.x:8080
    Connection: keep-alive
    Content-Length: 39
    Cache-Control: max-age=0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    Origin: http://a.x.x.x:8080
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36
    Content-Type: application/x-www-form-urlencoded
    Referer: http://a.x.x.x:8080/servlet/Turbine/frm/single/
    Accept-Encoding: gzip, deflate
    Accept-Language: en-US,en;q=0.8,ru;q=0.6
    Cookie: JSESSIONID=89FCCCC7EA680EDE665A0DFA898C6FB0; locale=en-US; pem_skin_version=3

    Response
    Code:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Set-Cookie: JSESSIONID=885950DFDB6691BC5D6BB906C2FC6A65; Path=/; HttpOnly
    Cache-Control: max-age=600
    Expires: Mon, 25 May 2015 10:11:00 GMT
    Content-Type: text/html;charset=ISO-8859-1
    Content-Length: 185
    Date: Mon, 25 May 2015 10:01:00 GMT

    But in a raw format the response is:
    Code:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Set-Cookie: JSESSIONID=885950DFDB6691BC5D6BB906C2FC6A65; Path=/; HttpOnly
    Cache-Control: max-age=600
    Expires: Mon, 25 May 2015 10:11:00 GMT
    Content-Type: text/html;charset=ISO-8859-1
    Content-Length: 185
    Date: Mon, 25 May 2015 10:01:00 GMT
    
    <html><head><script>top.name='2ad22b822bbe9008f240708eb1de8d85';  top.location.href='/workspace.html?bw_id=2ad22b822bbe9008f240708eb1de8d85&cp=prv';</script></head><body></body></html>

    How can I get the "top.name=" value? Is it possible?
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    Don't be 100% sure and use some regexp tester (POSIX flavor).
    At least "top.name" in your regexp should be "top\.name" :-)
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    • sheh1000
      Junior Member
      • May 2015
      • 3

      #3
      Web monitoring configuration

      I tried both.

      https://regex101.com/ says it is correct.
      Anyway it is not working even with 'top\.name='

      Comment

      • jan.garaj
        Senior Member
        Zabbix Certified Specialist
        • Jan 2010
        • 506

        #4
        OK. Could you show your full logs and your web monitoring settings please?
        Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
        My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

        Comment

        • SubZr0
          Junior Member
          • Apr 2019
          • 2

          #5
          Was this ever solved? It looks like you are trying to log into an odin automation platform.. ( or cloudblue these days ) i am trying to do the same thing, to measure login time and to see if the cp is available.

          Comment

          • SubZr0
            Junior Member
            • Apr 2019
            • 2

            #6
            i used regex: regex:bw_id=([0-9a-z]{32}) and i do login the next step: constructing the url(
            https://cp.someisp.eu/workspace.html?bw_id={bw_id}&cp=prv
            )
            works, but i cannot get any word on that page ...

            Comment

            Working...