Skip to main content

No project description provided

Project description

This utility provides a script with a “ping” like interface to ping tcp port services.

Build Status


To install serviceping, first make sure you are running Python 3.6+, then simply:

$ pip install serviceping

or from source:

$ pip install .


usage: serviceping [-h] [-c COUNT] [-i INTERVAL] [-d]
                   destination [destination ...]
positional arguments:
  destination Destination host or URL

optional arguments:
  -h, --help   show this help message and exit
  -c COUNT     Number of pings to send
  -i INTERVAL  Ping interval
  -d           Show timings for the entire connection


The serviceping tool uses a syntax that mirrors that of the ping commmand.

Ping port 80 (http) on

By pinging via http (port 80), we can clearly see the multiple hosts responding and the latency of each request.

$ serviceping
from ( time=2.46 ms
from ( time=2.43 ms
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1704.0ms
rtt min/avg/max/dev = 2.43/2.44/2.46/4.00 ms

Same thing using ssl

Serviceping can also connect to other ports such as the ssl port (443).

$ serviceping
from ( time=2.89 ms
from ( time=2.81 ms
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1744.0ms
rtt min/avg/max/dev = 2.81/2.85/2.89/6.08 ms

Pinging a URL instead of the port

Portping can also specify a URL. If a URL is specified, it will perform an http get request and show the response, which is useful when hosts are doing unexpected things in a dns rotation or behind a reverse proxy or vip.

In this example we specify a url of

$ serviceping
1500 bytes from ( time=87.14 ms
1448 bytes from ( time=64.82 ms
1500 bytes from ( time=62.98 ms
1500 bytes from ( time=78.30 ms
--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 4372.0ms
rtt min/avg/max/dev = 62.98/73.31/87.14/56.00 ms

The output shows that two hosts are responding to this request, and that they are returning different amounts of data in their responses.

Pinging a URL with timings

The detailed timing flag adds timings for each step of each request, which is useful for determining the causes of latency issues or errors.

Here we are doing the previous example with detailed timings.

$ serviceping -d
1386 bytes from ( dns=0.21ms connect=68.36ms request=130.02ms all=198.73ms
1386 bytes from ( dns=0.30ms connect=66.72ms request=101.07ms all=168.20ms
1500 bytes from ( dns=0.30ms connect=123.94ms request=203.08ms all=327.43ms
1386 bytes from ( dns=0.28ms connect=68.32ms request=87.94ms all=156.69ms
--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 5009.0ms
rtt min/avg/max/dev = 156.69/212.76/327.43/138.24 ms

Clearly, the host with address is taking significantly longer to establish the tcp connection and handle the http get request.


Code is licensed under Apache License 2.0

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
serviceping-18.8.1-py3-none-any.whl (9.7 kB) Copy SHA256 hash SHA256 Wheel 3.6
serviceping-18.8.1.tar.gz (8.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page