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

G.W. Haywood ged at jubileegroup.co.uk
Sun Jun 15 11:31:36 CEST 2008


Hi there,


On Sun, 15 Jun 2008, David Tomic wrote:

> Here's what I get from running smokeping --debug
>
> 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
>
> <snip>
>
> Calling RRDs::update(/var/lib/smokeping/TEST/tcpping-ip-test.rrd
> --template uptime:loss:median:ping1:ping2:ping3:ping4:ping5
> 1213505540:U:5:U:U:U:U:U:U)
> Calling RRDs::update(/var/lib/smokeping/TEST/tcpping-test.rrd --template
> uptime:loss:median:ping1:ping2:ping3:ping4:ping5 1213505540:U:5:U:U:U:U:U:U)
>
> My graphs are all just showing 100% packet loss.
>
> If I execute the same command as smokeping is doing, then I seem to get
> proper results so I'm really not sure what the problem is?
>
> david at david-desktop:~$ /usr/bin/tcpping -C -x 5 203.16.214.17 80
>  25.130 23.576 23.224 24.626 21.697
>
> david at david-desktop:~$ /usr/bin/tcpping -C -x 5 internode.on.net 80
>  24.153 24.062 21.473 24.742 26.168
>
>
> If anybody can offer any help/suggestions, then I would REALLY
> appreciate it!

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'.  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<----------------------------------------------------------------------

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:

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.. :)

--

73,
Ged.



More information about the smokeping-users mailing list