[smokeping-users] TCPPing probe doesn't generate data

David Tomic young_einstein at internode.on.net
Sun Jun 15 16:05:13 CEST 2008


Thanks for the reply Ged,

G.W. Haywood wrote:
>
> Assuming that you have in fact installed 'tcptraceroute', then I think
> the problem is that the output from tcptraceroute isn't being parsed
> correctly by 'tcpping'.  

Yes, both tcpping and tcptraceroute are both definitely installed, and 
I've also made sure that all the relevant paths are correct.


> That's probably because the two authors don't
> talk to each other much about this.  There follows a really crude hack:
>
> The shell script 'tcpping' is in /usr/bin/ (or wherever you have put it).
>
> In it you will find a function called _testsite().
>
> In that function you will find these lines:
> 8<----------------------------------------------------------------------
>        if echo "${ttr}" | egrep "\[(open|closed)\]" >/dev/null 2>&1; then
>                rtt=`echo "${ttr}" | awk '{print $5}'`
>        else
>                rtt=`echo "${ttr}" | awk '{print $4}'`
>        fi
> 8<----------------------------------------------------------------------
>
> Try commenting out all but the penultimate line there, so you have instead
>
> 8<----------------------------------------------------------------------
> #       if echo "${ttr}" | egrep "\[(open|closed)\]" >/dev/null 2>&1; then
> #               rtt=`echo "${ttr}" | awk '{print $5}'`
> #       else
>                 rtt=`echo "${ttr}" | awk '{print $4}'`
> #       fi
> 8<----------------------------------------------------------------------
>   

I've done that, but unfortunately it doesn't seem to have helped.

Now when I execute tcpping myself, I'm not getting the latency figures 
returned properly.

8<----------------------------------------------------------------------


david at david-desktop:~$ /usr/bin/tcpping -C -x 5 203.16.214.17 80
 - - - - -
david at david-desktop:~$ /usr/bin/tcpping -C -x 5 internode.on.net 80
  - - - - -

8<----------------------------------------------------------------------


[The dashes '-' are all that it's returning as output now.]

There still doesn't seem to be any data being passed through to 
smokeping either.  From 'smokeping --debug' I'm still just getting:

8<----------------------------------------------------------------------

TCPPing: forks 5, timeout for each target 76
TCPPing: Executing /usr/bin/tcpping -C -x 5 203.16.214.17 80
TCPPing: Executing /usr/bin/tcpping -C -x 5 internode.on.net 80
TCPPing: 203.16.214.17: got
TCPPing: internode.on.net: got

8<----------------------------------------------------------------------


I hope I'm correct in thinking that I shouldn't need to do anything 
[beyond modifying tcpping] to actually have those changes take effect 
within Smokeping.

IE - Once I've modified/saved tcpping, then Smokeping should just 
automatically pick up on the changes the next time it executes the 
tcpping probe, correct?

> If that doesn't work, get back to me on this list.  If you want to debug
> it yourself and come up with a more robust fix than this, try putting a
> few debug lines in the script.  Here's what I used, I inserted them just
> before the lines I'm taking about above:
>
> echo "${ttr}"
> echo ""
> echo "field 1 =" `echo "${ttr}" | awk '{print $1}'`
> echo "field 2 =" `echo "${ttr}" | awk '{print $2}'`
> echo "field 3 =" `echo "${ttr}" | awk '{print $3}'`
> echo "field 4 =" `echo "${ttr}" | awk '{print $4}'`
> echo "field 5 =" `echo "${ttr}" | awk '{print $5}'`
> echo "field 6 =" `echo "${ttr}" | awk '{print $6}'`
>
> With these debug lines inserted, but without my modification (sorry,
> my nasty hack:), you'll see that the information you need moves from
> field to field, depending on how you specify the host to be pinged:
>   
Okay ...

> tornado:/usr/bin$ >>> /usr/bin/tcpping -C -x 1 localhost 80
> 255  localhost (127.0.0.1) [open]  0.095 ms
>
> field 1 = 255
> field 2 = localhost
> field 3 = (127.0.0.1)
> field 4 = [open]
> field 5 = 0.095              <<<<<<<<<<<<<<<<<<<<<<
> field 6 = ms
> localhost : 0.095
> tornado:/usr/bin$ >>> /usr/bin/tcpping -C -x 1 217.147.177.250 80
> 255  www.jubileegroup.co.uk (217.147.177.250) [open]  34.580 ms
>
> field 1 = 255
> field 2 = www.jubileegroup.co.uk
> field 3 = (217.147.177.250)
> field 4 = [open]
> field 5 = 34.580              <<<<<<<<<<<<<<<<<<<<<<
> field 6 = ms
> 217.147.177.250 : 34.580
> tornado:/usr/bin$ >>> /usr/bin/tcpping -C -x 1 www.jubileegroup.co.uk 80
> 255  www.jubileegroup.co.uk (217.147.177.250) [open]  35.832 ms
>
> field 1 = 255
> field 2 = www.jubileegroup.co.uk
> field 3 = (217.147.177.250)
> field 4 = [open]
> field 5 = 35.832              <<<<<<<<<<<<<<<<<<<<<<
> field 6 = ms
> www.jubileegroup.co.uk : 35.832
> tornado:/usr/bin$ >>> /usr/bin/tcpping -C -x 1 pk2 80
> 255  192.168.0.43 [open]  0.199 ms
>
> field 1 = 255
> field 2 = 192.168.0.43
> field 3 = [open]
> field 4 = 0.199              <<<<<<<<<<<<<<<<<<<<<<
> field 5 = ms
> field 6 =
> pk2 : -
> tornado:/usr/bin$ >>> /usr/bin/tcpping -C -x 1 pk2.local.jubileegroup.co.uk 80
> 255  192.168.0.43 [open]  0.184 ms
>
> field 1 = 255
> field 2 = 192.168.0.43
> field 3 = [open]
> field 4 = 0.184              <<<<<<<<<<<<<<<<<<<<<<
> field 5 = ms
> field 6 =
> pk2.local.jubileegroup.co.uk : -
>
>
> That's not good.  A better modification than my hack would be to make
> sure that the output from tcptraceroute is parsed properly instead of
> just hoping that the data will be in field 4.  I'll leave that as an
> exercise for you.. :)
>   

I've done that, and I'm getting the same sort of output as you, but [if 
you'll pardon my ignorance] I'm still not really sure what that's 
actually achieved?

I still don't seem to be getting any data sent through to smokeping?

Thanks a lot for your help anyway though ... it really is appreciated!

Regards,
--David Tomic



More information about the smokeping-users mailing list