Windows Ping
Moderators: Developers, Moderators
Windows Ping
I would like to measure latency under windows, but the current ping.pl is for unix. Anyone have a working ping.pl that support windows 2000? Also, what changes do I need to make on my graphs.
If you have perl installed, you can try the following by adding the 4th line and modifying the 5th line.
There's only one "problem" that has to do with the difference between the windows ping and the linux ping. Windows will only return time in ms. If something is less than 1 ms it displays it as "time<1ms" instead or using usec. Therefore anything that's less than 1 second away will always be 1.
Code: Select all
#!/usr/bin/perl
$ping = `ping -c 1 $ARGV[0] | grep icmp_seq`;
if ($ping == "") { $ping = `ping -n 1 $ARGV[0] | grep TTL`; }
$ping =~ m/(.*time.)(.*)(ms|usec)/;
print $2;
uname -a
Who is online
Users browsing this forum: No registered users and 1 guest