<div class="gmail_quote">On Mon, Dec 7, 2009 at 11:17 AM,  <span dir="ltr"><<a href="mailto:thorsten.erdmann@daimler.com">thorsten.erdmann@daimler.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br><font face="sans-serif" size="2">Hi,</font><br><br><font face="sans-serif" size="2">I want to do some application tests
on several servers. All these test should be under one column named "app".
Every test is unique for one server. So test "app" on "server1"
is different from "app" on server2. All these test run remotely
on the hobbit server, not on the destination servers.</font><br><br><font face="sans-serif" size="2">For now I wrote a test-script for every
test and define a unique testname for the bbhost file for every test-script.
In the script I reported to the "app" column. Works fine, but
I have to include every test-script in the hobbitlaunch file and so all
these tests run simultaneously, resulting in a big number of processes
on the hobbit server. </font><br><br><font face="sans-serif" size="2">So I  think of writing _one_ testscript
for the "app" test and let this script decide which subscript
should be run for each host. So all the different tests would be run under
one master test script and so I hopefully get only one process.</font><br><br><font face="sans-serif" size="2">   BBHTAG=app    
   # What we put in bb-hosts to trigger this test</font><br><font face="sans-serif" size="2">   COLUMN=app    
      # Name of the column, often same as tag in bb-hosts</font><br><br><font face="sans-serif" size="2">   TEMPFILE_OUTPUT=$BBTMP/$BBHTAG.output.tmp</font><br><font face="sans-serif" size="2">   TEMPFILE=$BBTMP/$BBHTAG.tmp</font><br>
<font face="sans-serif" size="2">   $BBHOME/bin/bbhostgrep
$BBHTAG | while read L</font><br><font face="sans-serif" size="2">   do</font><br><font face="sans-serif" size="2">      echo "found
hosts: $L"</font><br><font face="sans-serif" size="2">      rm $TEMPFILEOUTPUT
>/dev/null 2>&1</font><br><font face="sans-serif" size="2">      set $L    #
To get one line of output from bbhostgrep</font><br><font face="sans-serif" size="2">      HOSTIP="$1"</font><br><font face="sans-serif" size="2">      MACHINEDOTS="$2"</font><br><font face="sans-serif" size="2">      MACHINE=`echo $2
| $SED -e's/\./,/g'`</font><br><br><font face="sans-serif" size="2">      COLOR=green</font><br><font face="sans-serif" size="2">      echo "Application
test on $MACHINEDOTS" > $TEMPFILE</font><br><br><font face="sans-serif" size="2">      if "$MACHINE"
== "server1"</font><br><font face="sans-serif" size="2">         .
apptest_server1.sh</font><br><font face="sans-serif" size="2">      fi</font><br><font face="sans-serif" size="2">      if "$MACHINE"
== "server2"</font><br><font face="sans-serif" size="2">         .
apptest_server2.sh</font><br><font face="sans-serif" size="2">      fi</font><br><font face="sans-serif" size="2">      MSG=`cat $TEMPFILE_OUTPUT
| fold -s -w 100`</font><br><br><font face="sans-serif" size="2">      if [ $DEBUG = TRUE
]</font><br><font face="sans-serif" size="2">      then</font><br><font face="sans-serif" size="2">        echo "status
$MACHINE.$COLUMN $COLOR `date` $MSG"</font><br><font face="sans-serif" size="2">      else</font><br><font face="sans-serif" size="2">        $BB $BBDISP
"status $MACHINE.$COLUMN $COLOR `date` $MSG"</font><br><font face="sans-serif" size="2">      fi</font><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><font face="sans-serif" size="2">Thank you </font><br><font face="sans-serif" size="2">Thorsten Erdmann<br></font><font face="sans-serif"><font face="sans-serif, Arial, Helvetica" size="-1" color="#808080"><br>If
you are not the intended addressee, please inform us immediately that
you have received this e-mail in error, and delete it. We thank you for
your cooperation.
<br> 
                                                                          
</font></font></blockquote></div><font face="sans-serif" size="2">      rm $TEMPFILE_OUTPUT
>/dev/null 2>&1</font><br><font face="sans-serif" size="2">    done</font><br><br><font face="sans-serif" size="2">    exit 0</font><br><br><br><font face="sans-serif" size="2">What do you think of this method? Maybe
you have a better idea?</font><br><br></blockquote><div> </div><div>I've used cron quite effectively.  Most of the scripts were repeating every ten minutes, so I could schedule where in the ten minute block the tests would start.   I also had some tests running every 5 minutes, 3 minutes, 1 minute and 30 seconds, so occasionally there would be a "planetary alignment" when a large bunch of tests ran together, causing a cpu spike on the server.<br>
<br>In my case, I was running a bunch of checks on web servers, so each "parent" script started by cron would run through a loop running a "child" script against each of a list of web servers.  If the script finishes quickly, a bunch can be backgrounded to run near simultaneously, something like this:<br>
<br>     for x in  1 2 3 4 5 6 7 8<br>     do<br>       $SCRIPTDIR/script server$x   &<br>     done<br>     wait<br><br><br>Ralph Mitchell<br><br></div></div>