Windows Ping

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
Guest

Windows Ping

Post by Guest »

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.
jvona@xtekinc.net

Post by jvona@xtekinc.net »

I too would like to have this, can't find one for win32 anywhere???
Thanks
jvona@xtekinc.net

Post by jvona@xtekinc.net »

I too would like to have this, can't find one for win32 anywhere???
Thanks
pbulteel
Cacti User
Posts: 150
Joined: Fri Sep 05, 2003 9:20 am
Location: London
Contact:

Post by pbulteel »

If you have perl installed, you can try the following by adding the 4th line and modifying the 5th line.

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;
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.
uname -a
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest