SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6

Thread: remote agents

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Location
    Portland, ME USA
    Posts
    603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    remote agents

    Is there a way to tell if an agent you are trying to connect to is already running a test?
    N+ CNA

  2. #2
    Super Member
    Join Date
    Jul 2003
    Location
    Boulder, CO
    Posts
    1,276
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remote agents

    Try Connect()ing to it inside a do-except construct. I think that you'd get a predictable exception code back it is busy.
    Chris R Mead

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Location
    Portland, ME USA
    Posts
    603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remote agents

    I tried that thinking it would let you, but i can spawn on test on machine 1, then the spawn a test on machine 1 again, without any errors.. Silktest get confused as to what to and crashes..though.
    N+ CNA

  4. #4
    Senior Member
    Join Date
    Jan 2003
    Location
    Portland, ME USA
    Posts
    603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remote agents

    Can you provide an example.. I am a little fuzzy on this one..


    Thanks
    N+ CNA

  5. #5
    Super Member
    Join Date
    Jul 2003
    Location
    Boulder, CO
    Posts
    1,276
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remote agents

    Basically you should be able to check if an agent is running a script from inside the machine where the script is running or from the machine where the GUI is running, because there is a TCP/IP connection that is only 'ESTABLISHED' when a test is running.

    Make a simple script like this:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">main()
    Connect()
    Agent.DisplayMessage (&quot;test&quot;,&quot;test&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Run it and the agent will block and remain in running mode. Then type 'netstat -ano -p TCP' from the machine where the GUI is running. Look for the IP of the machine you are connecting to in the Foreign Address column. You should find a row that ends in ESTABLISHED.

    Now click OK on the agent popup and the script ends. Now type 'netstat -ano -p TCP' again on the machine where the GUI is running. The row you saw before will either be gone or it will end in TIME_WAIT now.

    You can call:
    LIST OF STRING outStuff
    SYS_Execute ("netstat -ano -p TCP", outStuff)
    from the GUI machine without a running agent I think.

    Basically you can check the same stuff from inside the machine under test, but the GUI machine's IP will then be in the Foreign Address column.

    This might be enough to parse through (not tested):
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">// Example ipAndPort =&gt; &quot;10.0.0.40:2965&quot;
    // 10.0.0.40 -&gt; ip of client with agent in question
    // 2965 -&gt; port that this agent is listening on
    BOOLEAN agentExecutingTestcase(STRING ipAndPort)
    LIST OF STRING outStuff
    SYS_Execute (&quot;netstat -ano -p TCP&quot;, outStuff)

    STRING indexStr
    for each indexStr in outStuff
    if (MatchStr(&quot;*{ipAndPort}*&quot;, indexStr ))
    if (MatchStr(&quot;*ESTABLISHED*&quot;, indexStr))
    return TRUE
    return FALSE</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

    [ 12-15-2005, 05:48 PM: Message edited by: Chris Mead ]
    Chris R Mead

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

  6. #6
    Super Member
    Join Date
    Jul 2003
    Location
    Boulder, CO
    Posts
    1,276
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remote agents

    Are you using TCP/IP?

    I noticed while checking out netstat details for some other post that you can tell if the agent is connected to the gui using netstat.

    If you call netstat -ano and parse through the data (first look only at rows with agent pid) you can tell if the agent is connected to the gui.

    You see something like this:

    agentmachines.ip.address.here:2965 0.0.0.0:0

    if the agent is idle. Note that there is also a connection the license server. Ignore this one (port 5461 on my machine).

    If a test is running with that agent, you see:

    agentmachines.ip.address.here:2965 guimachine.ip.address.here:1519

    Note that the old line is still in the output too, so you need to be smart in your parser.
    Chris R Mead

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:13 AM.

Copyright BetaSoft Inc.