mping is a terminal-based multi-target ping tool written in Go. It pings multiple hosts simultaneously and displays real-time statistics — packet loss, RTT, TTL, and more — in a clean TUI (Text User Interface).
- Multi-target ping — monitor multiple hosts concurrently in a single view.
- Real-time statistics — packet loss, RTT, TTL, and error messages updated live.
- TUI dashboard — high-visibility table on a black background. Column widths are distributed automatically based on terminal width; switches to a compact 2-row-per-target layout when the window is narrow.
- Color-coded alerts — loss ratio, RTT, and Jitter are color-coded for instant status recognition. Alerts are recorded in the Log pane when thresholds are exceeded.
- Flexible configuration — specify interface, source IP, packet size, send count, and more.
- YAML host list — manage target hosts in a file.
- Traceroute pane — show the route to each target in a Host/Route table when
-Tis given. Multiple targets are traced concurrently and displayed together. - MTR Monitor pane — continuous per-hop loss/latency statistics when
-Mis given. Each hop is probed every second and displays Hop, Host, Loss%, Snt, Recv, Last, Avg, Min, Max, Jitter — the same columns asmtr. Can be used simultaneously with-T. - Port Monitor pane — monitor TCP/UDP port reachability in real time with
-p. Displays the estimated service name, cumulative Open/Closed counts, and time since last status change. - PMTU discovery — probe maximum payload size using DF-bit ICMP packets.
- Auto source IP detection — automatically detects and displays the local IP used for each destination.
- RTT graph — fixed range of 0–100 ms (Y-axis) × 30 seconds (X-axis) per target.
- CSV log output — save results with statistics to a file.
- JSON statistics export — write a live snapshot of all statistics to a JSON file every 5 seconds with
-j.
| OS | Architecture | Notes |
|---|---|---|
| Linux | amd64, arm64 | Recommended: grant CAP_NET_RAW via setcap |
| macOS | amd64, arm64 (Apple Silicon) | Uses setuid |
Privileges required — mping uses raw ICMP sockets to obtain accurate TTL values. On Linux the preferred approach is granting
CAP_NET_RAWwithsetcap;install.shhandles this automatically. On macOS asetuidbit is set instead.
Terminal Compatibility — Standard terminals on Linux and macOS may not render colors correctly. If you experience issues with color display, consider using a modern terminal emulator (e.g., iTerm2, Alacritty, or kitty).
Download the archive for your platform from the Releases page and run the bundled install.sh.
# Download and extract (replace vX.Y.Z with the latest version)
curl -LO https://github.com/nagayon-935/mping/releases/download/vX.Y.Z/mping-vX.Y.Z-linux-amd64.tar.gz
tar -xzf mping-vX.Y.Z-linux-amd64.tar.gz
# Install (grants CAP_NET_RAW via setcap; falls back to setuid if setcap is unavailable)
sudo ./install.shcurl -LO https://github.com/nagayon-935/mping/releases/download/vX.Y.Z/mping-vX.Y.Z-linux-arm64.tar.gz
tar -xzf mping-vX.Y.Z-linux-arm64.tar.gz
sudo ./install.shcurl -LO https://github.com/nagayon-935/mping/releases/download/vX.Y.Z/mping-vX.Y.Z-darwin-amd64.tar.gz
tar -xzf mping-vX.Y.Z-darwin-amd64.tar.gz
sudo ./install.shcurl -LO https://github.com/nagayon-935/mping/releases/download/vX.Y.Z/mping-vX.Y.Z-darwin-arm64.tar.gz
tar -xzf mping-vX.Y.Z-darwin-arm64.tar.gz
sudo ./install.shinstall.sh copies the binary to INSTALL_DIR (default: /usr/local/bin) and sets the appropriate privilege:
- Linux —
setcap cap_net_raw+ep(falls back tosetuidifsetcapis not available) - macOS —
chown root+chmod u+s(setuid)
To install to a different directory:
sudo INSTALL_DIR=/usr/local/bin ./install.shAfter installation, run mping without sudo:
mping google.com 1.1.1.1Requirements: Go 1.24 or later
git clone https://github.com/nagayon-935/mping.git
cd mping# Build only
make build
# Build + install (sets setuid on macOS; use install.sh on Linux for setcap)
make installNote for Linux users:
make installsets asetuidbit, which works but is less secure thansetcap. For production use, rungo build -o mping ./cmd/mainand thensudo ./install.shto getCAP_NET_RAWviasetcap.
go build -o mping ./cmd/main
sudo ./install.sh# Basic (no sudo needed after install.sh)
mping google.com 1.1.1.1 8.8.8.8
# Specify network interface
mping -I eth0 google.com
# Set packet size (100 bytes) and count (10 packets)
mping -s 100 -c 10 google.com
# Save results to a CSV file
mping -o results.csv google.com
# Load hosts from a YAML file
mping -f hosts.yaml
# Force IPv4 only
mping -4 google.com
# Force IPv6 only
mping -6 google.com
# Show Traceroute pane
mping -T google.com
# PMTU discovery (probes from payload size 9872 downward)
mping -m google.com
# TCP port reachability check (443/tcp)
mping -p 443/tcp google.com
# Multiple ports (comma-separated)
mping -p 443/tcp,53/udp google.com 8.8.8.8
# MTR-style per-hop monitor
mping -M google.com
# MTR + Traceroute simultaneously
mping -T -M google.com
# Traceroute + Port Monitor simultaneously
mping -T -p 443/tcp google.com
# Export live statistics to a JSON file (updated every 5 s)
mping -j stats.json google.com 1.1.1.1
# Customise colour-coding thresholds (warn = orange, crit = red)
mping --rtt-warn 30 --rtt-crit 100 --loss-warn 10 --loss-crit 50 google.com
# Display AS numbers for target IPs
mping -a google.com 1.1.1.1If you run mping without installing (i.e. without
setcap/setuid), prependsudo:sudo ./mping google.com
List hosts under the hosts: key. Options specified here are overridden by explicit CLI flags.
hosts:
- google.com
- 1.1.1.1
interval: 500
timeout: 2000
traceroute: true
mtr: true
asn: true
port:
- 443/tcp
- 53/udp
json-output: stats.json
thresholds:
rtt-warn: 50 # ms (orange)
rtt-crit: 200 # ms (red)
jitter-warn: 10 # ms (orange)
jitter-crit: 50 # ms (red)
loss-warn: 20 # percent (orange)
loss-crit: 80 # percent (red)| Flag | Short | Description | Default |
|---|---|---|---|
--interval |
-i |
Ping send interval (ms) | 1000 |
--timeout |
-t |
Ping timeout (ms) | 1000 |
--file |
-f |
Path to YAML host list file | "" |
--traceroute |
-T |
Show Traceroute pane | false |
--mtr |
-M |
Show MTR Monitor pane (continuous per-hop loss/latency) | false |
--discovery-mtu |
-m |
Discover max payload size with DF bit | false |
--interface |
-I |
Network interface name (e.g. eth0, en0) |
"" |
--source |
-S |
Source IPv4 address | "" (auto-detect) |
--size |
-s |
Payload size in bytes | 56 |
--count |
-c |
Number of packets per target (0 = unlimited) | 0 |
--ipv4 |
-4 |
Use IPv4 only | false |
--ipv6 |
-6 |
Use IPv6 only | false |
--output |
-o |
CSV log output file path | "" |
--port |
-p |
Ports to check (e.g. 443/tcp, 53/udp, 443). Comma-separated for multiple. |
"" |
--json-output |
-j |
Write a JSON statistics snapshot to this file every 5 seconds | "" |
--asn |
-a |
Look up and display AS numbers for target IPs | false |
--rtt-warn |
RTT warn threshold in ms (orange) | 50 |
|
--rtt-crit |
RTT crit threshold in ms (red) | 200 |
|
--jitter-warn |
Jitter warn threshold in ms (orange) | 10 |
|
--jitter-crit |
Jitter crit threshold in ms (red) | 50 |
|
--loss-warn |
Loss warn threshold in percent (orange) | 20 |
|
--loss-crit |
Loss crit threshold in percent (red) | 80 |
Thresholds —
warnis the orange boundary andcritthe red boundary for colour-coding the Loss Ratio, RTT, and Jitter columns (and for triggering alert log entries). For each metricwarnmust be less thancrit. These can also be set in thethresholds:block of the YAML file.
| Key | Action |
|---|---|
| q | Quit the application |
| s | Pause ping |
| S | Resume ping (only valid after s) |
| R | Reset all statistics and logs |
| Tab | Cycle focus: Ping Monitor → Traceroute Monitor → MTR Monitor → Port Monitor → RTT Graphs → Log |
| ↑ / ↓ / PgUp / PgDn | Scroll focused pane (Table / Traceroute / RTT Graphs) |
- Src IP — Local IP address used for sending.
- Dst IP — Resolved destination IP. Shown as
domain (IP)when a hostname is given. - ASN — Autonomous System Number of the target IP (enabled with
-a). - Success — Number of packets received successfully.
- Loss — Number of lost packets.
- Loss Ratio — Packet loss percentage. Colour boundaries are configurable (defaults shown).
- Green: 0%–20% | Orange: 20%–80% | Vivid red: >80%
- RTT / Avg / Jitter — Latest / average / jitter round-trip time. Colour boundaries are configurable (defaults shown).
- RTT: Green (≤50 ms) / Orange (≤200 ms) / Red (>200 ms)
- Jitter: Green (≤10 ms) / Orange (≤50 ms) / Red (>50 ms)
- Override with
--rtt-warn/--rtt-crit,--jitter-warn/--jitter-crit,--loss-warn/--loss-crit, or thethresholds:YAML block.
- Size — Payload size of sent packets.
- MTU — MTU of the outbound interface.
- TTL — Time To Live of the last received packet.
- Error — Abbreviated latest error message (red). Full details appear in the Log pane.
- Last Loss — Time elapsed since the last packet loss.
- Shown only when
-T/--tracerouteis given. - Probes up to 30 hops and displays results in a Host / Route two-column table.
- Multiple targets are traced concurrently and separated by divider rows.
- One traceroute is run at startup, then automatically refreshed every 10 minutes.
- Shown only when
-M/--mtris given. - Performs continuous TTL-limited ICMP probing to every hop on the path to each target.
- The hop path is discovered at startup and re-discovered every 10 minutes to track route changes.
- Each hop is probed once per second. Unresponsive hops (
*) accumulate 100% loss. - The header row shows
SrcIP -> DstIP(orhostname (SrcIP -> DstIP)for hostname targets). - Can be combined with
-T(both panes are displayed side by side). - Columns:
- Hop — TTL hop number
- Host — Responder IP (and ASN when
-ais given).*when no response. - Loss% — Packet loss percentage for this hop (green / orange / red)
- Snt — Total probes sent
- Recv — Total replies received
- Last — RTT of the most recent probe
- Avg — Average RTT
- Min — Minimum RTT
- Max — Maximum RTT
- Jitter — Smoothed inter-packet delay variation (RFC 1889)
- On narrow terminals, Min, Max, Recv, and Jitter columns are hidden automatically (compact mode).
- MTR statistics are included in the
-jJSON export asmtr_hopsper target.
- Shown only when
-p/--portis given. - Performs TCP/UDP reachability checks in real time at the ping interval.
- Multiple ports can be specified comma-separated (e.g.
-p 443/tcp,53/udp). - Omitting the protocol defaults to TCP (e.g.
-p 443→443/tcp). - Columns:
- Target — Hostname
- Port — Port number and protocol (e.g.
443/tcp) - Service — Estimated service name (
Unknownif not recognized) - Status — Green
Open/ RedClosed/ YellowFilteredorOpen|Filtered - Open/Closed — Cumulative Open count / Closed+Filtered count
- Last Change — Time elapsed since the last status change
- Enabled with
--discovery-mtu/-m. - Probes maximum payload size using DF-bit ICMP, starting from 9872 bytes.
- The discovered size is reflected in the Size column.
MIT