[Memphis.pm] Net::Ping spawned from earlier discussion
Keith W. Sheffield
sheff at pobox.com
Tue Oct 3 21:29:19 CDT 2000
>>>>> "Durango" == Durango <durango at linuxfiles.net> writes:
> #!/usr/bin/perl -w use Net::Ping; my $host = "www.yahoo.com";
> $p = Net::Ping->new(); print "$host is alive.\n" if
> $p->ping($host); $p->close();
This works if you are root:
$host="www.yahoo.com";
$p = Net::Ping->new('icmp');
print "$host is ", ($p->ping($host)) ? "alive\n" : "dead\n";
$p->close();
Not specifying a protocol or using 'tcp' or 'udp' all return dead.
--
So let it be written. So let it be done. To kill the first born pharaoh son.
I'm creeping Death. -- RTL:CD c4-7
Keith W. Sheffield sheff at pobox.com
GPG fingerprint = 7219 D5CB 8B10 8602 2B81 AFC3 3D48 FA3F 4F51 93C9
----------------------------------------------------------------------------
To unsubscribe, please send email to majordomo at pm.org
with 'unsubscribe memphis-pm-list' in the body of the message.
----------------------------------------------------------------------------
More information about the Memphis-pm
mailing list