Problems with Net::Ping 
Author Message
 Problems with Net::Ping

I'm trying to use the Net::Ping module in a program and I found that
fails in the ping method. I ran the program in 3 different machines with

4 perl versions:
1) rs6000/AIX 4.2.1 version 5.005_01 built for aix
2) intel 486/redhat 5.1 version 5.004_04 built for i386-linux
3) intel 486/redhat 5.1 version 5.005_02 built for i486-linux
4) intel 486/windows 95 binary build 502 provided by ActiveState
5) intel 486/windows 95 binary distribution version 5.004_02

The program only works in the rs6000. I gave the code to a friend, who
ran it in a sun and also worked.
Could anyone give me some help?

Thanks in advance,
    Marcelo.

Marcelo Guelfi

ps. This the source of the program (adapted  from "Perl CookBook")

#!/usr/local/bin/perl
use Net::Ping;

$p = Net::Ping->new() or die "Can't create the object\n";
if ($p->ping($host) ){
        print "$host is alive\n";

Quote:
} else {

        print "$host is dead\n";
Quote:
}

$p->close();


Mon, 16 Apr 2001 03:00:00 GMT  
 Problems with Net::Ping
You've made a great effort with these various environments. Now...
1. Please provide the per-host error messages.
2. Can these hosts ping themselves?
3. If the Perl code is identical, the non-Perl code is the problem, eh Dr
Watson? Yes Sherlock.
--
Ron Savage


http://www.ozemail.com.au/~rpsavage

[snip]



Mon, 16 Apr 2001 03:00:00 GMT  
 Problems with Net::Ping
1) Error messages (I included diagnostics module):

1.1)In  5.005_02 built for i486-linux version the error messages is:

Use of uninitialized value at /usr/lib/perl5/5.00502/i486-linux/Socket.pm
line
        275 (#1)

    (W) An undefined value was used as if it were already defined.  It was
    interpreted as a "" or a 0, but maybe it was a mistake.  To suppress this

    warning assign an initial value to your variables.

Uncaught exception from user code:
        Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be
16 at /usr/lib/perl5/5.00502/i486-linux/Socket.pm line 275.
        Socket::sockaddr_in(undef) called at
/usr/lib/perl5/5.00502/Net/Ping.pm line 374
        Net::Ping::ping_udp('Net::Ping=HASH(0x80c2054)', '^JM-S^Gd', 5)
called at /usr/lib/perl5/5.00502/Net/Ping.pm line 152
        Net::Ping::ping('Net::Ping=HASH(0x80c2054)', 10.211.7.100) called at
./ping.pl line 8

1.2) In intel 486/windows 95 binary build 502 provided by ActiveState the
error message is :

host is dead (where host is the address received as argument by the program)

2) The hosts can't ping themselves (using  the "ping perl program") but yes
can using the "/usr/bin/ping" or "c:\windows\ping.exe".

Thanks in advance,
    Marcelo.

Marcelo Guelfi

.

Quote:

> You've made a great effort with these various environments. Now...
> 1. Please provide the per-host error messages.
> 2. Can these hosts ping themselves?
> 3. If the Perl code is identical, the non-Perl code is the problem, eh Dr
> Watson? Yes Sherlock.
> --
> Ron Savage


> http://www.ozemail.com.au/~rpsavage

> [snip]



Tue, 17 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problems with Net::Ping

2. Problem with Net::Ping

3. problems implimenting Net::Ping in Perl for Win32

4. Problem with Net::Ping

5. Problems using Net::Ping

6. Net::Ping - ping Linux host problem

7. Net::Ping causing a die when trying to ping

8. Net::Ping won't ICMP ping under W32

9. Re Another Net::Ping problem

10. WIN32 NET::PING Problem

11. Net::Ping problem

12. Net::Ping problem with sol 5.8

 

 
Powered by phpBB® Forum Software