Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Ping sweep with reporting

by StarkRavingCalm (Sexton)
on May 17, 2007 at 21:36 UTC ( #616113=note: print w/ replies, xml ) Need Help??


in reply to Ping sweep with reporting

Ok, here's what I have:

#!/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

And here's the output:
root@stewie ~# perl pingsweep_pm.pl
isn't pinging

Thoughts?


Comment on Re: Ping sweep with reporting
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://616113]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (17)
As of 2015-09-02 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (84 votes), past polls