|Perl: the Markov chain saw|
Collecting ping timesby EyeOpener (Scribe)
|on Aug 18, 2003 at 16:41 UTC||Need Help??|
EyeOpener has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a script to log ping latencies for a bunch of hosts on our network. It works well for the most part, but there's a bug that rears it's head sporadically, and I haven't been able to track it down.
Here's the meat of the code (some vars are defined earlier in the script):
This produces output that looks like:
This is handy for importing into a spreadsheet or database, averaging the ping times, etc.
Now, the problem. If I let this run for several minutes, eventually I get output like this:
In case that lost or gained some formatting during posting, the problem is that the code eventually skips one host, then stops printing the @times values and the following newline for all successive iterations. The code continues running and logging, but appends only the date, time, and hostname. This last line grows longer ad infinitum.
I'm only just starting to troubleshoot this, but I need to get it running pretty quickly, so I thought I'd open it up to the Monks as well. Is there a flaw in the code, or is there a network condition that could cause this oddness?