[ale] IP addresses

Bob Kruger krugerb at benning.army.mil
Thu Aug 17 14:45:17 EDT 2000


Carl Forsell wrote:
> 
> Does anyone know of software that can ping a range of IP addresses and
> report on which are available?  Manualy pinging each IP address is a pain.

Ok - a quick and dirty script that I wrote to help me with this task. 
You can edit as necessary.

---------------------------------------------------------------------
 
#!/bin/bash
export TZ=EST5EDT
ip1="150.226.80."
# starting ip number
ip2="1"
while [ $ip2 -le 255 ] ; do
   dt=`date '+%d%b%Y' `
   tm=`date '+%H%M' `
   ipn="$ip1$ip2"
   ping -c3 -q  $ip1$ip2 > /dev/null
      if [ $? -eq 0 ] ; then
         hwa="On line              "
      else
         hwa="Not active or on line"
      fi
      echo -e "$ipn \t\t $hwa \t$dt   $tm"
      ip2=`expr $ip2 + 1`
done                                                                 


---------------------------------------------------------------------

Enjoy.

Regards - Bob Kruger
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list