Use the attached Perl script and the rest is easy. You can select ICMP, UDP, or TCP as well as the number of tries and the timeout for each. All you have to do is test the result; 0 --> Good.
#!/usr/bin/sh
HOSTS="huey louie dewey"
for HOST in ${HOSTS}
do
ping.pl -t 5 -n 3 ${HOST}
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "${HOST} is alive."
else
echo "${HOST} failed; status ${STAT}." >&2
fi
done
--------------------------------------
Invoke as ping.pl -u for full usage.
If it ain't broke, I can fix that.