Skip to content

command line tutorial

Mehrdad Arshad Rad edited this page Dec 16, 2020 · 2 revisions

Command line tutorial

In case you want to run tcpprobe through docker container you can add the below alias at your shell configuration otherwise you can use the binary file.

alias tcpprobe='docker run -p 8082:8082 --rm mehrdadrad/tcpprobe:latest'

Filter metrics

Filter specific metrics

tcpprobe -json -filter "Retransmits;TCPConnect;HTTPStatusCode" https://www.google.com
{"HTTPStatusCode":200,"Retrans":0,"Retransmits":0,"TCPConnect":6469}

Enable gRPC

tcpprobe -grpc

Bind to specific IP address

tcpprobe -grpc -grpc-addr 192.168.1.2:8082

SMTP probing

tcpprobe -c 1 -json smtp.gmail.com:587
{"Target":"smtp.gmail.com:587","IP":"74.125.142.109","Timestamp":1608152852,"Seq":0,"State":1,"CaState":0,"Retransmits":0,"Probes":0,"Backoff":0,"Options":4,"Rto":275000,"Ato":0,"SndMss":1460,"RcvMss":536,"Unacked":0,"Sacked":0,"Lost":0,"Retrans":0,"Fackets":0,"LastDataSent":0,"LastAckSent":0,"LastDataRecv":0,"LastAckRecv":0,"Pmtu":1500,"RcvSsthresh":29200,"Rtt":74964,"Rttvar":37482,"SndSsthresh":2147483647,"SndCwnd":10,"Advmss":1460,"Reordering":3,"RcvRtt":0,"RcvSpace":29200,"TotalRetrans":0,"PacingRate":386318,"BytesAcked":1,"BytesReceived":0,"SegsOut":2,"SegsIn":1,"NotsentBytes":0,"MinRtt":74964,"DataSegsIn":0,"DataSegsOut":0,"DeliveryRate":0,"BusyTime":0,"RwndLimited":0,"SndbufLimited":0,"Delivered":1,"DeliveredCe":0,"BytesSent":0,"BytesRetrans":0,"DsackDups":0,"ReordSeen":0,"RcvOoopack":0,"SndWnd":0,"TCPCongesAlg":"cubic","HTTPStatusCode":0,"HTTPRcvdBytes":0,"HTTPRequest":0,"HTTPResponse":0,"DNSResolve":2951,"TCPConnect":75203,"TLSHandshake":0,"TCPConnectError":0,"DNSResolveError":0}

Pretty JSON

Print out the output in pretty json format

tcpprobe -json-pretty https://www.google.com
{
  "Target": "https://www.google.com",
  "IP": "216.58.217.196",
  "Timestamp": 1607998042,
  "Seq": 0,
  "State": 1,
  "CaState": 0,
  "Retransmits": 0,
  "Probes": 0,
  "Backoff": 0,
  "Options": 4,
  "Rto": 202000,
  "Ato": 40000,
  "SndMss": 1460,
  "RcvMss": 1460,
  "Unacked": 0,
  "Sacked": 0,
  "Lost": 0,
  "Retrans": 0,
  "Fackets": 0,
  "LastDataSent": 69,
  "LastAckSent": 0,
  "LastDataRecv": 0,
  "LastAckRecv": 0,
  "Pmtu": 1500,
  "RcvSsthresh": 52560,
  "Rtt": 1788,
  "Rttvar": 1360,
  "SndSsthresh": 2147483647,
  "SndCwnd": 10,
  "Advmss": 1460,
  "Reordering": 3,
  "RcvRtt": 0,
  "RcvSpace": 29200,
  "TotalRetrans": 0,
  "PacingRate": 16328813,
  "BytesAcked": 448,
  "BytesReceived": 10558,
  "SegsOut": 10,
  "SegsIn": 12,
  "NotsentBytes": 0,
  "MinRtt": 150,
  "DataSegsIn": 8,
  "DataSegsOut": 3,
  "DeliveryRate": 8690476,
  "BusyTime": 1000,
  "RwndLimited": 0,
  "SndbufLimited": 0,
  "Delivered": 4,
  "DeliveredCe": 0,
  "BytesSent": 447,
  "BytesRetrans": 0,
  "DsackDups": 0,
  "ReordSeen": 0,
  "RcvOoopack": 0,
  "SndWnd": 0,
  "TCPCongesAlg": "cubic",
  "HTTPStatusCode": 200,
  "HTTPRcvdBytes": 14795,
  "HTTPRequest": 106245,
  "HTTPResponse": 891,
  "DNSResolve": 4535,
  "TCPConnect": 2729,
  "TLSHandshake": 36155,
  "TCPConnectError": 0,
  "DNSResolveError": 0
}