Skip to main content

Tracepath implemented in Python3

Project description

Python Tracepath

This is a subset version of the tracepath command written in Python3. The program supports both IPv4 and IPv6.

One interesting point of this program is that it provides maximum continous failure count parameter to stop measurement when no response is received.

Although this software is a pure Python3 code, it may not work on platforms other than Linux beacuse of lack of supported ancillary data types of the socket interface.

Installation

Install using pip, or type python setup.py install.

Usage

A command line tool pytracepath is available.

usage: pytracepath [-h] [-4] [-6] [-m MAX_HOPS] [-e MAX_CONTINUOUS_FAILS]
                   HOSTNAME

positional arguments:
  HOSTNAME

optional arguments:
  -h, --help            show this help message and exit
  -4                    use IPv4
  -6                    use IPv6
  -m MAX_HOPS           maximum number of hops (TTL)
  -e MAX_CONTINUOUS_FAILS
                        maximum number of repeated probe fails

Using as a module

import pytracepath

tp = pytracepath.Tracepath('target.example.org',
                           ipv6=True,
                           max_hops=15,
                           max_continous_fail=5)
print(tp.start())

The start() method will return the histrory of responders of the probe packets. IPv6 is used and the maximum Hop Limit is 15 in the aboe example. Also, if the program failed to receive any response 5 times continuously while measuring, it will stop the rest of the measurement even though the Hop Limit is smaller than 15.

Code

The code is available at Github.

Project details


Download files

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

Source Distribution

pytracepath-keiichishima-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file pytracepath-keiichishima-0.0.1.tar.gz.

File metadata

  • Download URL: pytracepath-keiichishima-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for pytracepath-keiichishima-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0bf6ecaad62987a17112729e5d904e82015526947d534a91943d76c10f6b794c
MD5 6259cda8798dae554641f13662e13aa7
BLAKE2b-256 eae3deefd2a56556521e5ef8b749c5d906ccf2ba35a7f3913933721635382a16

See more details on using hashes here.

File details

Details for the file pytracepath_keiichishima-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pytracepath_keiichishima-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for pytracepath_keiichishima-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 daf9f8baaeef881936930a74d8fbca7c20b1b01d2de132d1c3d4785d749985c7
MD5 5a3d07f9ecf09de856135f778646ff1f
BLAKE2b-256 1c6c569b2fb96e293f31836b141ee4ddb23dcb78a2781929bfcdf3234706e194

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page