Discussion:
[smokeping-users] smokeping-users Digest, Vol 137, Issue 1
Tony DeMatteis
2018-09-21 15:08:33 UTC
Permalink
Greetings,

Is there anyone out there that might help shed some insight on my issue I
raised? Thank you so much.
Send smokeping-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of smokeping-users digest..."
1. Smokeping::probes::basefork:ping fails (Tony DeMatteis)
----------------------------------------------------------------------
Message: 1
Date: Wed, 5 Sep 2018 07:32:47 -0700
Subject: [smokeping-users] Smokeping::probes::basefork:ping fails
<
Content-Type: text/plain; charset="utf-8"
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
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 $target = $targetlookup{$ready};
my $tree = $target->{tree};
$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:");
chomp($outputline);
}
@times = map {sprintf "%.10e", $_ / $self->{pingfactor}} sort {$a <=> $b}
@times;
# DEBUG - Pings Post processing
logit("MikrotikRouterOSPing Pings Post Preprocessing. Returning this to
caller:");
my $parent = getcaller();
logit("MikrotikRouterOSPing Returning ping times to $parent");
}
*# Debug Logging results*
-------------------[ 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
' '
];
-------------------[ DEBUG ]---------------------
$VAR1 = [
'7',
'9',
'5',
'8',
'9',
'9',
'8',
'0',
'7',
'9',
'7',
'0',
'7',
'9',
'7',
'8',
'8',
'8',
'8',
'9',
'5'
];
-------------------[ 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/20180905/c6ad1ab0/attachment-0001.html
------------------------------
Subject: Digest Footer
_______________________________________________
smokeping-users mailing list
https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users
------------------------------
End of smokeping-users Digest, Vol 137, Issue 1
***********************************************
Loading...