1

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!

Hernan
  • 13
  • 2

1 Answers1

6

<rest of pipeline> | xargs ping -c 1

Rein Henrichs
  • 206
  • 1
  • 1