https://github.com/deajan/tcpping
tcpping script for smokeping that runs with newer linux traceroute binaries
https://github.com/deajan/tcpping
Last synced: about 1 month ago
JSON representation
tcpping script for smokeping that runs with newer linux traceroute binaries
- Host: GitHub
- URL: https://github.com/deajan/tcpping
- Owner: deajan
- Created: 2018-04-25T14:50:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T09:51:35.000Z (about 1 year ago)
- Last Synced: 2024-02-23T10:44:42.951Z (about 1 year ago)
- Language: Shell
- Homepage:
- Size: 72.3 KB
- Stars: 117
- Watchers: 6
- Forks: 40
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://opensource.org/licenses/GPL-3.0)
[](https://github.com/deajan/tcpping/releases/latest)
[](https://github.com/deajan/tcpping/actions/workflows/shellcheck.yml)# tcpping v2.x
A (quick and dirty) tool to ping TCP / UDP service ports
**Warning: With version 2.4, some defaults have changed:**
- Default timeout is now 1 second instead of 3
- Interval between pings is now automatically calculated to fit timeoutThese changes have been made to make Smokeping integration easier.
## fork of elder tcpping v1.8 script running with newer traceroute binary
This script is a fork of Richard Van den Berg's tcpping script, original version found [here](https://github.com/deajan/tcpping/tree/original-1.8), supporting newer traceroute binaries.
Usage is the same and should work out of the box for smokeping.It comes with various improvements like language agonstic functionality, better error detection, debug, and removed tcptraceroute dependancy, sub second pings and statistics.
So far, tests have been done with:
- CentOS 7: v2.0-2.3 tested (with traceroute 2.0.22 and bash 4.2.46(2)-release)
- CentOS 8: v2.3 tested (with traceroute 2.1.0 and bash 4.4.19(1)-release)
- AlmaLinux 9: v2.5 tested (with traceroute 2.1.0 and bash 5.1.8(1)-release)
- FreeBSD 11.2: v2.0-2.3 tested (with traceroute 1.4a12 and tcsh 6.20.00)
- Debian 12: v2.5 tested (with traceroute 2.1.2 and dash 0.5.12-2)
Also, smokeping 2.7.2 and 2.7.3 have been tested.The script works on bash, dash and zsh interpreters.
## Installation
```
sudo curl -o /usr/local/bin/tcpping -L https://raw.githubusercontent.com/deajan/tcpping/master/tcpping ; sudo chmod 755 /usr/local/bin/tcpping
```## Usage
Example command smokeping would use
`tcpping -C -x 5 myhost 80`
Example command for sub second tcp ping analysis on Linux
`tcpping -x 10 -w .1 -o myhost 443`
Keep in mind that the tcp / udp probe checks for a SYN flag, which does not mean that a service is listening on the target machine port.
## Root privileges
By default, traceroute needs root privileges.
You may launch script with sudo or with '-Z' in order to ask for root privileges during execution.
By doing so, you may edit your sudoers file by allowing user 'bob' to run traceroute as root without password
```
bob ALL=(ALL) NOPASSWD: /usr/bin/traceroute
```## Default options
You can set default options (like `-Z` required for smokeping) in a configuration file `/etc/tcpping.conf` that would contain default script arguments like `TCPPING_EXTRA_ARGS="-Z`.
## Licence and improvements
Altough there are probably better tools out there (hping, nmap, etc), this is still a quick and handy tool used by smokeping, so every improvement / fork / pull request is more than welcome.
Originally, Richard linked to the GPLv2 licence.
Having talked with him, he did allow to update to GPLv3, so this script is GPLv3.