pingraph

August 19, 2010

I am troubleshooting some network issues and was trying to find an automated way to continuously monitor connectivity between a host and a server. On thing that sprang to mind was to run ping in the background, with a reasonable interval, in the hopes of perhaps narrowing down the network issues to a particular time frame.

This resulted a ping dump with over 30 000 “samples” which weren’t that useful as such. So I wrote a little PHP script to parse the ping output. The script (which is now part of MTK) generates a CSV file with the first column being the timestamp and the second the ICMP ECHO delay. When I run Gnuplot on it, I get something that looks like this:

Which is actually pretty cool. I can see right away that during the 24 hours, the delay has never increased over 0.7 ms. There’s also an interesting gap around 0.2 ms.

pingraph also has another “mode” of operation. If the number of samples is small (<= 100), then it tells Keynote to draw the graph:

I found that anything above 100 data points chokes osascript.

Anyways, in a serious environment you’d probably have Nagios or some other nice tool to do this for you, but for my purposes this was good enough. Some day I’ll try to add a simple method to filter the data set to specific timeframes…