# send 1 ping... system("ping -c 1 $host >/dev/null 2>&1"); if ($?) { # dead perhaps, or just plain slow } else { # alive }