[smokeping-users] Smokeping::probes::basefork:ping fails

Tony DeMatteis tonydema at gmail.com
Mon Oct 8 15:34:55 CEST 2018


I was hoping someone could shed some light on this.  I originally posted my
issue back on Aug 30, 2018.  I am still unable to identify why I see the
value 'interrupted'.  I've googled the value "interrupted" w/  Perl at
nauseum with no results.

If there is anything I can provide that would assist one in helping me
identify the cause I would be glad to do so.  I've tried a fresh install of
smokeping and re-written my probe in an effort to eliminate any errant code
I may have introduced.  My probe does indeed get, parse, and return to the
basefork caller the values of the ping responses.  You can see this in the
from the first set of @times output.  Then you can see that the basefork
caller receives the values from my probe in the secound set of output.
I've referenced the line numbers in the basefork.pm module.  I'm using
v2.6.11.  And finally, the @times value resulting from the code at line 221
and splitting $response into an array - "interrupted".  So I don't believe,
on the surface, the issue is my probe not returning a result set.  But I
can't put my finger on why the "interrupted" response value.  Anyone...
Anyone at all with some suggestions please....  Thank you!

Daemonizing /usr/sbin/smokeping ...
Mon Oct  8 13:17:22 2018 - MikrotikRouterOSPing: Sleeping 8 seconds.
Mon Oct  8 13:17:30 2018 - MikrotikRouterOSPing: forks 5, timeout for each
target 401
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: MIKROTIK PROBE @times
===========================>
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 9.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 1.0000000000e-02
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: BASEFORK @times value line
207 =========>
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: my @times =
$self->pingone($t);
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 7.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 9.0000000000e-03
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 1.0000000000e-02
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: BASEFORK @times value line
221 =========>
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: my @times = split(/ /,
$response);
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: interrupted
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: 8.8.8.8: got interrupted
Mon Oct  8 13:17:50 2018 - MikrotikRouterOSPing: Sleeping 280 seconds.


On Thu, Aug 30, 2018 at 11:04 AM Tony DeMatteis <tonydema at gmail.com> wrote:

> Greetings,
>
> I have been attempting to debug an issue with a custom probe I've written
> based off the TelnetIOSPing probe.  The probe returns an array of ping
> results to the caller, Smokeping::probes::basefork::ping, but the "$result"
> variable read in the caller equals "interrupted".  I have been unable to
> get any further with identifying why this is the case.  I'm not an active
> perl programmer but drawing on some older experience.  I've included what I
> believe to be the pertinent code and some debug output; the values of the
> ping @output and  the @times array both before and after the processor
> which formats the times to values for RRD.  Perhaps it's something obvious
> and I apologize for that.  Any help pointing me in the right direction
> would be great.  Thank you
>
> The probe connects to a Mikrotik Router via SSH and retrieves ping stats.
> Then it parses the result with the exact same code as from the
> TelnetIOSPing probe.
>
> *# /usr/share/perl5/Smokeping/probes/base.pm <http://base.pm>*
> *# The only modification to the base.pm <http://base.pm> code is the
> do_debug statements*
>
>     while ($s->handles and $timeleft > 0) {
>       for my $ready ($s->can_read($timeleft)) {
>         $s->remove($ready);
>         my $response = <$ready>;
>         close $ready;
>
> *$self->do_debug("Returned from probe");*
> *$self->do_debug(Dumper \$response);  <--- Result = 'interrupted'*
>
>         chomp $response;
>         my @times = split(/ /, $response);
>         my $target = $targetlookup{$ready};
>         my $tree = $target->{tree};
>         $self->{rtts}{$tree} = \@times;
>
>         $self->do_debug("$target->{addr}: got $response");
>       }
>       $timeleft = $timeout - (time() - $starttime);
>     }
>
> *# /usr/share/perl5/Smokeping/probes/MikrotikRouterOSPing.pm*
> ...
>   #
>   # Get ping stats
>   #
>   if ( $psource ) {
>     @output = $ssh->capture("ping $dest count=$pings size=$bytes
> src-address=$psource");
>   } else {
>     @output = $ssh->capture("ping $dest count=$pings size=$bytes");
>   }
>   $ssh->system("quit");
>
> # DEBUG - Log raw result
> logit("MikrotikRouterOSPing Raw result from host:");
> logit(@output);
>
>   my @times = ();
>   while (@output) {
>     my $outputline = shift @output;
>     chomp($outputline);
>     $outputline =~ /(\d)ms/ && push(@times,$1);
>   }
>
> logit("MikrotikRouterOSPing \@times[] Pre Preprocessing.");
> logit(@times);
>
>   @times = map {sprintf "%.10e", $_ / $self->{pingfactor}} sort {$a <=>
> $b} @times;
>
> # DEBUG - Pings Post processing
> logit("MikrotikRouterOSPing Pings Post Preprocessing.  Returning this to
> caller:");
> logit(@times);
>
> my $parent = getcaller();
> logit("MikrotikRouterOSPing Returning ping times to $parent");
>
>   return @times;
> }
>
> *# Debug Logging results*
>
> MikrotikRouterOSPing Raw result from host:
> -------------------[ DEBUG ]---------------------
> $VAR1 = [
> ',        '  SEQ HOST                                     SIZE TTL TIME
> STATUS
> ',        '    0 8.8.8.8                                56 255 7ms
> ',        '    1 8.8.8.8                                56 255 9ms
> ',        '    2 8.8.8.8                                56 255 5ms
> ',        '    3 8.8.8.8                                56 255 8ms
> ',        '    4 8.8.8.8                                56 255 9ms
> ',        '    5 8.8.8.8                                56 255 9ms
> ',        '    6 8.8.8.8                                56 255 8ms
> ',        '    7 8.8.8.8                                56 255 10ms
> ',        '    8 8.8.8.8                                56 255 7ms
> ',        '    9 8.8.8.8                                56 255 9ms
> ',        '   10 8.8.8.8                                56 255 7ms
> ',        '   11 8.8.8.8                                56 255 10ms
> ',        '   12 8.8.8.8                                56 255 7ms
> ',        '   13 8.8.8.8                                56 255 9ms
> ',        '   14 8.8.8.8                                56 255 7ms
> ',        '   15 8.8.8.8                                56 255 8ms
> ',        '   16 8.8.8.8                                56 255 8ms
> ',        '   17 8.8.8.8                                56 255 8ms
> ',        '   18 8.8.8.8                                56 255 8ms
> ',        '   19 8.8.8.8                                56 255 9ms
> ',        '    sent=20 received=20 packet-loss=0% min-rtt=5ms avg-rtt=8ms
> max-rtt=10ms
> '         '
>         ];
> MikrotikRouterOSPing @times[] Pre Preprocessing.
> -------------------[ DEBUG ]---------------------
> $VAR1 = [
>           '7',
>           '9',
>           '5',
>           '8',
>           '9',
>           '9',
>           '8',
>           '0',
>           '7',
>           '9',
>           '7',
>           '0',
>           '7',
>           '9',
>           '7',
>           '8',
>           '8',
>           '8',
>           '8',
>           '9',
>           '5'
>         ];
> MikrotikRouterOSPing Pings Post Preprocessing.  Returning this to caller:
> -------------------[ DEBUG ]---------------------
> $VAR1 = [
>           '0.0000000000e+00',
>           '0.0000000000e+00',
>           '5.0000000000e-03',
>           '5.0000000000e-03',
>           '7.0000000000e-03',
>           '7.0000000000e-03',
>           '7.0000000000e-03',
>           '7.0000000000e-03',
>           '7.0000000000e-03',
>           '8.0000000000e-03',
>           '8.0000000000e-03',
>           '8.0000000000e-03',
>           '8.0000000000e-03',
>           '8.0000000000e-03',
>           '8.0000000000e-03',
>           '9.0000000000e-03',
>           '9.0000000000e-03',
>           '9.0000000000e-03',
>           '9.0000000000e-03',
>           '9.0000000000e-03',
>           '9.0000000000e-03'
>         ];
> MikrotikRouterOSPing Returning ping times to
> Smokeping::probes::basefork::ping
> Thu Aug 30 15:22:50 2018 - MikrotikRouterOSPing: Returned from probe
> *Thu Aug 30 15:22:50 2018 - MikrotikRouterOSPing: $VAR1 = \'interrupted*
> *';*
> *Thu Aug 30 15:22:50 2018 - MikrotikRouterOSPing: 8.8.8.8
> <http://8.8.8.8>: got interrupted*
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/smokeping-users/attachments/20181008/03381156/attachment-0001.html>


More information about the smokeping-users mailing list