Ad Widget

Collapse

Simulating Mouse Click For web Synthetic Transaction

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • girishkg
    Junior Member
    • Aug 2011
    • 11

    #1

    Simulating Mouse Click For web Synthetic Transaction

    Its web monitoring section is monitoring 79 web services of our corporate network on different geo locations across the globe,, each of 6 scenarios (Steps - First Page, Login, Search, Check, Logout, Logout Check), drawing nice graphs. Triggers are just unbelievable to go with.
    ====================
    Here is my requirement:
    1) I want to simulate mouse clicks on Synthetic Txn instead of URL based Txn
    Reason: All 79 Websites are jsp based and mostly many inside url will not be available as the script runs on server.
    Ex-1: To check items after login require a mouse click, which is not referred by a link
    Ex-2: Right click is required to get some items to choose which are not available through direct link
    Ex-3: Should be able to click on Search result
    2) What Macros have to be posted on web scenarios? Is there any manual or wiki on all available macros?
    ===================
    I am already set with zabbix with amazing customized graphs/screens and dashboards, so I won't mind spending some time to work with macros.
    Can you please guide me on this with an example if possible?!!
    Girish KG
    ===============
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    clicking on elements in page is not supported currently (as libcurl doesn't support such things). i'd also argue that right click in web pages/applications is a bad design

    you might be able to integrate with something like selenium, but that definitely won't be trivial
    Zabbix 3.0 Network Monitoring book

    Comment

    • girishkg
      Junior Member
      • Aug 2011
      • 11

      #3
      Re:Simulating Mouse Click For web Synthetic Transaction

      Is there any way of working with JSP pages where direct URL are not available?
      For example, I can login with direct POST, but not able to "Logout" by just simulating/posting "{logout}=Logout&enter=Enter" as "Logout" button is not available to call directly.
      Ex-2: I can call "Logout" from zabbix with a link "http://10.11.100.36/index.php?reconnect=1" but not the same on some JSP pages which doesn't give urls as such.

      Any help/work around/suggestion would be helpful for me here. My intension is to simulate Synthetic Txn on JSP sites similar to user.

      Thanks for your valuable time.

      Comment

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        some users have implemented that as external scripts, but that won't be available in the built-in web monitoring views
        Zabbix 3.0 Network Monitoring book

        Comment

        • girishkg
          Junior Member
          • Aug 2011
          • 11

          #5
          Re:Simulating Mouse Click For web Synthetic Transaction

          Thanks for your time again..
          I will be waiting to hear from the users who have implemented it...Thanks

          Comment

          • girishkg
            Junior Member
            • Aug 2011
            • 11

            #6
            Re:Simulating Mouse Click For web Synthetic Transaction

            Have anyone implemented this type of synthetic txn to JSP pages?
            I am still waiting to see a light on this way. Thanks.

            Comment

            • danrog
              Senior Member
              • Sep 2009
              • 164

              #7
              I have done this using webinject...its a perl module and/or script...(they provide a working script but it uses their own perl module, so you could write your own if you wanted). I only did this because some of our web apps include an auth ticket in the query string that is used only on the first HTTP GET and since Zabbix does not currently support grabbing values and using them on subsequent requests I was stuck building something.

              I had a working setup using Selenium but it wasn't very reliable (not sure why, it think there were many factors involved, but I didn't really care about using actual mouse clicks to drive the app so I moved on - I might revisit it one day).


              Webinject. Contribute to sni/Webinject development by creating an account on GitHub.


              I used the nagios.pm notification plugin as a base and changed it to use zabbix_sender...

              Zabbix.pm
              PHP Code:
                          for my $file (@{$webinject->{'result'}->{'files'}}) {
                              for 
              my $case (@{$file->{'cases'}}) {
                                  
              my $warn   $case->{'warning'}  || 0;
                                  
              my $crit   $case->{'critical'} || 0;
                                  
              my $label  $case->{'label'}    || 'CASE'.$case->{'id'};
                                  
              $perfdata .= ' '.$label.'='.$case->{'latency'}.';'.$warn.';'.$crit.';0;0';
                                  
              $lastid $case->{'id'};
                                  
              my $sendercli "/home/zabbix/sbin/zabbix_sender -z btcboszab01.btci.com -s $webinject->{'config'}->{baseurl} -k web.syn.test[$label] -o $case->{'latency'} 2>&1";
                                  
              my $sender = `/home/zabbix/sbin/zabbix_sender -z btcboszab01.btci.com -s $webinject->{'config'}->{baseurl} -k web.syn.test[$label] -o $case->{'latency'} 2>&1`;
                              print 
              $sendercli."\n".$sender."\n";
                              }
                          } 

              The down fall of this is you have to build items manually on each website you want that corresponds to each of the test case labels in the webcheck script.

              Here is a sample of a web check...

              app-config.xml:
              PHP Code:
              <testcasefile>/home/zabbix/httptests/app/app.xml</testcasefile>
              <
              globalhttplog>onfail</globalhttplog>
              <
              reporttype>external:/home/zabbix/httptests/Zabbix.pm</reporttype>
              <
              baseurl>app.domain.com</baseurl>
              <
              break_on_errors>1</break_on_errors>
              <
              output_dir>/home/zabbix/httptests/logs/app/</output_dir
              Using firebug or an equivelent tool, you should be able to get all the proper POST/GET fields and URLs to build a test case.

              app.xml:
              PHP Code:
              <testcases repeat="1">

              <
              testvar varname="URL">http://app.domain.com</testvar>
              <testvar varname="LOGIN">user</testvar>
              <
              testvar varname="PASSWD">pass</testvar>
              <
              testvar varname="NUMBER">xxxxxxxx</testvar>
              <
              testvar varname="ACCOUNT">xxxxxx</testvar>
              <
              testvar varname="SERVICE">xxxxx</testvar>
              <
              testvar varname="PASSCODE">xxxxxx</testvar>


              <case
                  
              id="1"
                  
              description1="App Login"
                  
              label="App_Login"
                  
              method="post"
                  
              url="${URL}/cas/login?service=${URL}/app"
                  
              postbody="username=${LOGIN}&password=${PASSWD}&service=${URL}/app"
                  
              logrequest="no"
                  
              logresponse="no"
                  
              sleep="1"
                  
              parseresponse='ticket=|"'
              />

              <case
                  
              id="2"
                  
              label="App_Home_Page"
                  
              description1="App Home Page"
                  
              method="get"
                  
              url="${URL}/app/?ticket={PARSEDRESULT}"
                  
              logrequest="no"
                  
              logresponse="no"
                  
              verifypositive="Search"
              />

              <case
                  
              id="3"
                  
              label="App_Contact_Search"
                  
              description1="App Contact Search"
                  
              method="post"
                  
              url="${URL}/app/ws/person/query"
                  
              postbody='{"type":"STANDARD", "resultList":[],  "totalResults":0}'
                  
              addheader="Content-Type: application/json"
                  
              logrequest="no"
                  
              logresponse="no"
                  
              sleep="1"
                  
              verifypositive="${NUMBER}"
              />

              <case
                  
              id="4"
                  
              label="App_Contact_Details"
                  
              description1="App Contact Details"
                  
              method="post"
                  
              url="${URL}/app/contact/load.initialize?action=VIEW&cid=14831"
                  
              logrequest="no"
                  
              logresponse="no"
                  
              sleep="1"
                  
              verifypositive="${ACCOUNT}"
              />

              <case
                  
              id="5"
                  
              label="App_Contact_Services"
                  
              description1="App Contact Services"
                  
              method="get"
                  
              url="${URL}/app/meeting/listContactServices.initialize"
                  
              logrequest="no"
                  
              logresponse="no"
                  
              sleep="1"
                  
              verifypositive="${SERVICE}"
              />

              <case
                  
              id="6"
                  
              label="App_Details"
                  
              description1="App Details"
                  
              method="post"
                  
              url="${URL}/app/meeting/listContactServices.process"
                  
              postbody="_CHECKBOXES=&meetingType=xxxxx"
                  
              logrequest="no"
                  
              logresponse="no"
                  
              sleep="1"
                  
              verifypositive="${PASSCODE}"
              />
              <case
                  
              id="7"
                  
              label="App_Logout"
                  
              description1="App Logout"
                  
              method="get"
                  
              url="${URL}/cas/logout?service=${URL}/app"
                  
              logrequest="no"
                  
              logresponse="no"
                  
              sleep="1"
                  
              verifypositive="Login"
              />
              </
              testcases
              You would then run via cron...

              # Webinject HTTP Tests
              */5 * * * * zabbix perl /usr/bin/webinject.pl -c /home/zabbix/httptests/app/app-config.xml >/dev/null 2>&1

              Comment

              Working...