in reply to Ping sweep with reporting
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.#!/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
|
|---|