New TraceroutePing probe module

Here's a module to traceroute past an intermediate gateway, and use the TTL_EXCEEDED replies as data on the gateway.  It's about 8h old, so *perhaps* a bit green...

I didn't know about that (I'm working on FreeBSD 10.1 which has Perl 
5.14) but I do now.  I also see some other problems (hostnames, IPv6, 
etc), so I need to do some more work...

regards,

   --jh

On 11/24/14, 2:22 AM, Tobias Oetiker wrote:
>
> In lib/Smokeping/probes/TraceroutePing.pm:
>
> > +	    chomp($line);
> > +	    $self->do_debug("Received: $line");
> > +	    next unless $line =~ /^\s+\d+\s+\S+\s+(\d|\.|,)+\s+\S+\s*$/; # only match RTT output
> > +
> > +	    my @fields = split(/\s+/,$line);
> > +	    shift @fields if @fields[0] eq '';
> > +	    $self->do_debug("fields: " . join(':',@fields));
> > +	    next unless $host eq @fields[1];
> > +
> > +	    my $time = @fields[2];
> > +	    # Adjust time units to smokeping's preferred units.  I'm
> > +	    # not sure any traceroute implementations actually change
> > +	    # their units.
> > +	    for (@fields[3]) {
> > +		when (/^s(|ec(|ond))$/i) { }
> > +		when (/^(m|milli)s(|ec(|ond))$/i) { $time /= 1000 }
>
> does this work with perl 5.20 ? due to smartmatch deprectaion ?
>
> maybe just use the simple
>
> |for ($x){
>     /match/ && do { ... ; next; }
>    ...
> }
> |
>
> form
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/oetiker/SmokePing/pull/27/files#r20775336>.
>