summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Smokeping/probes/FPing.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Smokeping/probes/FPing.pm b/lib/Smokeping/probes/FPing.pm
index 2b932bf..0901201 100644
--- a/lib/Smokeping/probes/FPing.pm
+++ b/lib/Smokeping/probes/FPing.pm
@@ -32,6 +32,9 @@ your system yet, you can get a slightly enhanced version from L<www.smokeping.or
The (optional) B<packetsize> option lets you configure the packetsize for the pings sent.
+Since version 3.3 fping sends its statistics to stdout. Set B<usestdout> to 'true'
+so make smokeping read stdout instead of stderr.
+
In B<blazemode>, FPing sends one more ping than requested, and discards
the first RTT value returned as it's likely to be an outlier.
@@ -142,7 +145,8 @@ sub ping ($){
$self->do_debug("Executing @cmd");
my $pid = open3($inh,$outh,$errh, @cmd);
$self->{rtts}={};
- while (<$errh>){
+ my $fh = $self->{properties}{usestdout} || '') eq 'true' ? $outh : $errh;
+ while (<$fh>){
chomp;
$self->do_debug("Got fping output: '$_'");
next unless /^\S+\s+:\s+[-\d\.]/; #filter out error messages from fping
@@ -194,6 +198,12 @@ sub probevars {
_doc => "Send an extra ping and then discarge the first answer since the first is bound to be an outliner.",
},
+ usestdout => {
+ _re => '(true|false)',
+ _example => 'true',
+ _doc => "Listen for FPing output on stdout instead of stderr ... (version 3.3+ sends its statistics on stdout).",
+
+ },
timeout => {
_re => '(\d*\.)?\d+',
_example => 1.5,