I had a _lot_ of trouble with Net::Ping a month or so ago, using Windows. It would return a status of 'not alive' when a ping from the command line would show that the same host obviously _was_ alive. The same thing happened whatever ping 'level' I used in the perl script (ICMP or one of the others).
I suspect it had something to do with the fact that cygwin was installed on my PC, although luckily in my case the ping functionality was an 'optional extra' so I was able to abandon the attempt for now. I see you are also running on Windows. Do you also have cygwin installed on your PC by any chance? Cheers John R Ramsden -----Original Message----- From: Stuart Kendrick [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 14:29 To: [EMAIL PROTECTED] Subject: Net::Ping issues Hi, I'm running into intermittent problems pinging hosts. I have a script which walks my IP space, pinging every address and recording whether that address answered or not. The pinging part is performed in a routine called "&is_alive". code snippet: ------------------------------------------------------------------ # Send an ICMP Echo to the target, set $alive appropriately $p = Net::Ping->new("icmp", $icmpTimeout); if ($p->ping($target)) { $alive = 1; } else { $alive = 0; } $p->close(); _____________________________________________________________________ Of the addresses within my /16 IP space, only a few thousand actually answer. Sometimes the script makes it all the way through without a hitch; sometimes I see the following. [...] Entering &main::is_alive 140.107.26.248 is alive Leaving &main::is_alive Entering &main::is_alive Use of uninitialized value in subroutine entry at C:/Perl/lib/Socket.pm line 370. Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at C:/Perl/lib/Socket.pm line 370. C:\temp> Right at the moment, 140.107.26.249 (the address which the script was pinging when crumped), isn't returning pings. I can't guarantee that this was the case a few hours ago, though, when the script ran into this issue. Has anyone seen this before? I see one reference to this error, when google for it ... looks like someone else saw this a couple years ago ... but I saw no resolution in that thread. If you have debugging hints, I would appreciate that, too. I think I'm looking at a bug inside WinXP's support for ICMP ... or inside the Net::Ping module ... or perhaps, though this would be unlikely, inside Socket.pm. But I haven't a clue about how to gather debug information inside Perl modules I'm calling ... or that are being called by modules I'm calling ... not sure how to proceed there. I'm running a packet capture right now, figuring that if the script crumps again, I can examine the last ICMP Echo/Reply exchange, to see if something funny occurs there. Any pointers appreciated. --sk Stuart Kendrick FHCRC _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _____________________________________________________________________ This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
