in reply to Ping sweep with reporting

Here's a possibility from a Solaris server. Note that by default, ping on Solaris returns "server is alive" when the server can ping. Otherwise, the ping times out after a few seconds.
#!/usr/bin/perl use strict; use warnings; my $ping = "/usr/sbin/ping"; while (<DATA>){ chomp; my $ping_out = `$ping $_ 2> /dev/null`; chomp ($ping_out); if ($ping_out !~ /is alive/){ print "$_ isn't pinging\n"; } } __DATA__ server1 server2 server3
Another possibility is to use the ping -t 1 format on a linux server. If anything shows up in $ping_out, then the server is pingable, otherwise it's not.