Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Ok, here's what I have:
<code>
#!/usr/bin/perl
use strict;
use warnings;
my $ping = "/bin/ping";
while (<DATA>) {
chomp;
my $ping_out = `$ping $_ 2> /dev/null`;
chomp ($ping_out);
if ($ping_out !~ /bytes from/) {
print "$_ isn't pinging\n";
} else {
print "$_ is up\n";
}
}
__DATA__
myserver02
<code/>
And here's the output:
root@stewie ~# perl pingsweep_pm.pl
isn't pinging
Thoughts?
In reply to Re^4: Ping sweep with reporting
by StarkRavingCalm
|
|