I have this bash line that gives me the IPs of the EC2 instances attached.
export LB_NAME='lb'
ec2-describe-instances `elb-describe-instance-health $LB_NAME --show-long | cut -d , -f 2` | grep 'INSTANCE' | cut -f 4
This echoes something like this:
ec2-50-11-53-xx.compute-1.amazonaws.com
ec2-50-76-13-xx.compute-1.amazonaws.com
Now, as this list can get longer when the autoscaler adds more boxes to the loadbalancer, I would like to have a bash loop that pings each one of them regardless of how many are there.
Thanks a lot!