[mrtg] Re: Packet Loss from Ping

Jeff Liebermann jeffl at comix.santa-cruz.ca.us
Tue Dec 5 03:19:24 MET 2000


On Thu, Nov 16, 2000 at 07:04:28PM -0500, cpt2 at daimlerchrysler.com wrote:
> Has anyone implemented a graph of this from a Windoze box?  I'd like to get
> a graph of percent packet loss (as the ping command reports) on my NT
> server and was wondering if there is an existing script for this.

Can I talk you out of this idea?  Accurate packet loss is a
function of how many packets you ping with.  For example, if
you just ping with 3 packets, your choices are 0, 33%, 67%,
and 100%.  If you want 1% resolution, you'll need to ping
with 100 packets every 5 minutes.  If traffic gets high, many
routers simply drop or delay ICMP ping packets to insure the
important stuff gets through.  Using the ping packet loss is
not what I would consider practical or useful.

May I suggest you monitor TCP retransmissions at:
	1.3.6.1.2.1.6.12.0
and TCP traffic at:
	1.3.6.1.2.1.6.10.0  (in)
	1.3.6.1.2.1.6.11.0  (out)
The Retrans are the number of TCP "segments" that have to get
resent usually because of packet loss.  While this does nothing
for ICMP and UDP traffic, it does serve as a good indication
that something is amis in the link.  I use the percentage of 
TCP retrans to measure wireless link reliability which can
easily have a packet loss of 50% or more.

For NT ping times, I use the following mess.  Note that this
requires the Windoze 95/98 version of ping.exe which I
renamed to ping95.exe.
=========================================================
# MRTGPING.PL
# Plagerized by Jeff Liebermann from original by Tim Pozar.
# 09/14/00  First hack for NT.
#

$ipaddr = "NULL";
$ipaddr = $ARGV[0];
$numpings = 3;

if ($ipaddr eq "NULL"){
        print "Usage mrtgping.pl [ipaddress]\n";
        exit;
}

# Requires Windoze 95/98 version ping.exe renamed to ping95.exe
# Windoze 95/98 ping will return...
#    Minimum = 494ms, Maximum =  574ms, Average =  520ms
$result = `ping95 -n $numpings $ipaddr | find /i "average" `;

# Break result apart at the commas.
chop($result);
($Mins,$Maxs,$Avgs) = split(/,/,$result);

# Break each value apart at the = sign.
($Mint,$min) = split(/=/,$Mins);
($Maxt,$max) = split(/=/,$Maxs);
($Avgt,$avg) = split(/=/,$Avgs);

# Remove the "ms" at the end.
$min1 = substr($min,0,-2);
$max1 = substr($max,0,-2);
$avg1 = substr($avg,0,-2);
$min1 =~ s/ //g;
$max1 =~ s/ //g;
$avg1 =~ s/ //g;

print "$avg1\n";
print "$max1\n";
print "0\n";
print "$ipaddr\n";
=========================================================

-- 
# Jeff Liebermann  Liebermann Design  150 Felker St #D  Santa Cruz  CA  95060
# 831.336.2558 voice   831.426.1240 fax   831.421.6491 digital_pager
# jeffl at comix.santa-cruz.ca.us  http://www.cruzio.com/~jeffl

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list