# Author: Michael Collins (colli2mj@jmu.edu, mcollins@va.rr.com) # Description: A tool that will [eventually] go through a list # of IPs and attempt to connect to each. A message will be # returned if the connection fails. use Net::Telnet; $counter = 0; open(FILE, "/opt/mike/ips.lst") or die("Could not find list of IPs.\n"); while() { @ips[$counter++] = split; } close(FILE); print("ips in list: ", $#ips+1, "\n"); for($counter = 0; $current_ip <= $#ips; $current_ip++) { $telnet = new Net::Telnet(Timeout=>3); $telnet->open($ips[$current_ip]); print("IP just tried: ", $ips[$current_ip], "\n"); }