Dick, Brian E. wrote:
This is a simplified script. I need to execute the script body several
hundred times in a loop. I also need to run about twenty of them in
parallel. Here's my business problem and the pseudo code for the
solution. Maybe you can suggest another approach.
Problem: Simultaneously detect a DNS ip address change on twenty remote
hosts (window and unix).
Solution:
<for param="remotehost" list="host1..host20" parallel="true">
<sequence>
<remotepinguntil remotehost="@{host}" pinghost="theDNSHost"
ipaddress="123.456.789.012"/>
</sequence>
</for>
<macrodef name="remotepinguntil">
<attribute name="remotehost"/>
<attribute name="pinghost"/>
<attribute name="ipaddress"/>
<!--
On @{remotehost} ping @{pinghost} until the ipaddress =
@{ipaddress}
-->
</macrodef>
1. I think you will get burned by the JVM's caching of IP addresses if
you are not careful; you need to run jvms with IPAddr caching set to a
second or two instead of forever.
2. If I had something this complex I'd probably drop to java, use the
java1.5 ping api. If the nodes were all running smartfrog I'd deploy
components onto each box that do their own testing, and fail if the
condition is not met within a specified time period. Then I'd deploy
them with a parent component that runs them all and fails if one of the
children fail; have my hosted ant task do a blocking deployment of that
and be laughing.
3. Ant1.7 will have an <isreachable> condition that works on java1.5.
4. arp is the power tool for such situations; there is no ant task for
it (yet).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]