Guest_imported
New member
- Jan 1, 1970
- 0
I cannot get my ping program to wrok as it keeps giving me an error message like
"icmp ping requires root privelage at ping.pl line 11"
I am running it froma college server so does this mean that I have to get special permissions.
Here is the code I am trying to run.
===========================================
#!/usr/bin/perl
use Net:ing;
$p = Net:ing->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();
$p = Net:ing->new("icmp"
foreach $host (@host_array)
{
print "$host is ";
print "NOT " unless $p->ping($host, 2);
print "reachable.\n";
sleep(1);
}
$p->close();
$p = Net:ing->new("tcp", 2);
while ($stop_time > time())
{
print "$host not reachable ", scalar(localtime()), "\n"
unless $p->ping($host);
sleep(300);
}
undef($p);
# For backward compatibility
print "$host is alive.\n" if pingecho($host);
====================================================
Line 11 is the "$p = Net:ing->new("icmp"" line.
Hope you can help
"icmp ping requires root privelage at ping.pl line 11"
I am running it froma college server so does this mean that I have to get special permissions.
Here is the code I am trying to run.
===========================================
#!/usr/bin/perl
use Net:ing;
$p = Net:ing->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();
$p = Net:ing->new("icmp"
foreach $host (@host_array)
{
print "$host is ";
print "NOT " unless $p->ping($host, 2);
print "reachable.\n";
sleep(1);
}
$p->close();
$p = Net:ing->new("tcp", 2);
while ($stop_time > time())
{
print "$host not reachable ", scalar(localtime()), "\n"
unless $p->ping($host);
sleep(300);
}
undef($p);
# For backward compatibility
print "$host is alive.\n" if pingecho($host);
====================================================
Line 11 is the "$p = Net:ing->new("icmp"" line.
Hope you can help