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

Reply via email to