Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
But I want it to run thru a list and jump to different machines like souse strict; use warnings; use IO::Socket::PortState qw(check_ports); my %porthash = ( ... ); check_ports($host,$timeout,\%porthash); for my $proto (keys %porthash) { for(keys %{ $porthash{$proto} }) { print "$proto $_ is not open ($porthash{$proto}->{$_}->{name} +) if !$porthash{$proto}->{$_}->{open}; } }
#!/usr/bin/perl -w open (IN, "<hostnames.txt" ) || die "Cant open users.txt"; while(<IN>) { chomp; system("telnet $_"); ### get return status here?? }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing for port connectivity
by McDarren (Abbot) on Sep 04, 2006 at 12:30 UTC | |
by Anonymous Monk on Sep 04, 2006 at 16:43 UTC | |
|
Re: Testing for port connectivity
by JSchmitz (Canon) on Sep 04, 2006 at 12:20 UTC | |
|
Re: Testing for port connectivity
by brd (Acolyte) on Sep 05, 2006 at 16:25 UTC | |
by RobPayne (Chaplain) on Sep 05, 2006 at 22:29 UTC |