From 30e99f32be378fd13ceb9d70b905b9b53f92d919 Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Sun, 8 Jun 2008 21:49:42 +0000 Subject: added blazemode to fping probe --- CHANGES | 4 ++++ lib/Smokeping/probes/FPing.pm | 23 ++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 33b32ba..d3b815a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +* added blazemode option to FPing, so that it sends an extra ping to + blaze a path to the destionation and then discarges it. Based on idea by + G.W. Haywood -- tobi + * fix for telneJunOSPing by Christian Hahn -- tobi * fixed FPing regression created in r680 it broke the proper handling of old diff --git a/lib/Smokeping/probes/FPing.pm b/lib/Smokeping/probes/FPing.pm index 133996c..a0aae55 100644 --- a/lib/Smokeping/probes/FPing.pm +++ b/lib/Smokeping/probes/FPing.pm @@ -32,6 +32,9 @@ your system yet, you can get it from L. The (optional) B option lets you configure the packetsize for the pings sent. +In B, FPing sends one more ping than requested, and discards +the first RTT value returned as it's likely to be an outlier. + The FPing manpage has the following to say on this topic: Number of bytes of ping data to send. The minimum size (normally 12) allows @@ -41,6 +44,8 @@ timestamp). The reported received data size includes the IP header 40 bytes. Default is 56, as in ping. Maximum is the theoretical maximum IP datagram size (64K), though most systems limit this to a smaller, system-dependent number. + + DOC authors => <<'DOC', Tobias Oetiker @@ -118,10 +123,14 @@ sub ping ($){ do_log("WARNING: your fping binary doesn't support source address setting (-S), I will ignore any sourceaddress configurations - see http://bugs.debian.org/198486."); } push @params, "-S$self->{properties}{sourceaddress}" if $self->{properties}{sourceaddress} and $self->{enable}{S}; - + + my $pings = $self->pings; + if (($self->{properties}{blazemode} || '') eq 'true'){ + $pings++; + } my @cmd = ( $self->binary, - '-C', $self->pings, '-q','-B1','-r1', + '-C', $pings, '-q','-B1','-r1', @params, @{$self->addresses}); $self->do_debug("Executing @cmd"); @@ -134,7 +143,9 @@ sub ping ($){ my @times = split /\s+/; my $ip = shift @times; next unless ':' eq shift @times; #drop the colon - + if (($self->{properties}{blazemode} || '') eq 'true'){ + shift @times; + } @times = map {sprintf "%.10e", $_ / $self->{pingfactor}} sort {$a <=> $b} grep /^\d/, @times; map { $self->{rtts}{$_} = [@times] } @{$self->{addrlookup}{$ip}} ; } @@ -170,6 +181,12 @@ sub probevars { }, _doc => "The ping packet size (in the range of 12-64000 bytes).", + }, + blazemode => { + _re => '(true|false)', + _example => 'true', + _doc => "Send an extra ping and then discarge the first answer since the first is bound to be an outliner.", + }, timeout => { _re => '(\d*\.)?\d+', -- cgit v1.2.3-24-g4f1b