Front page | perl.beginners |
Postings from March 2002
Trouble with Net::Ping
Thread Previous
|
Thread Next
From:
jbajin
Date:
March 1, 2002 05:44
Subject:
Trouble with Net::Ping
Message ID:
ff.144513d3.29b0dfa2@aol.com
I am appearing to have some
troubles. It appears that it can not reach the hosts specified, but when I
try it manually it works just fine. Here is what I have for my code:
#!/usr/bin/perl -w
use strict;
use Net::Ping;
################Initalize Variables#####################
my @hosts= qw(au);
my $t;
my @lines;
my $hostname;
my %status;
#while(1){
$t = Net::Ping->new();
foreach $hostname (@hosts) {
if ($t->ping("ad.$hostname.doubleclick.net") ) {
$status{$hostname} = " is alive.\n";
print "This connection is alive.\n";
}else {
$status{$hostname} = "*** NOT PINGABLE!!
PLEASE CHECK!!***\n";
print "Thing connection is have problems.";
}
$t->close();
}
&emailstatus(%status)
....
The code goes on and I know that works but this part is where I am
having the troubles. Can someone maybe point me in the right direction.
Thanks,
Joseph Bajin
Associate Systems Administrator
Thread Previous
|
Thread Next