Geeklet script to ping hosts
You want to read up on loops in bash scripts.

For example:

HOSTS="hosta
hostb
hostc"

for machine in $HOSTS
do
  PING=`ping -q -c 1 $machine`
  if [[ $? -eq 0 ]] ; then
    TIME=`echo $PING |tail -1 | cut -d/ -f 5`
    echo ${TIME}ms away from $machine
  else
    echo $machine could not be reached
  fi
done


I didn't test that, but it's close enough. Replace the HOSTS list with the list of hosts you want to report on.