pingmon-0.1.2 is not a library.
pingmon
Real-time ping monitor with beautiful ASCII charts, TTL display, and comprehensive statistics.
Screenshot
Features
✨ Two Chart Types:
pingmon- Line chart using ASCII characterspingmon-bar- Vertical bar chart with filled blocks
📊 Real-time Visualization:
- Live latency chart that updates every ping
- Automatic terminal width detection
- Customizable chart height and width
📈 Comprehensive Statistics:
- Min/Max/Average latency
- Standard deviation
- Packet loss percentage
- Sent/Received/Lost packet counts
- TTL (Time To Live) display
🎨 Beautiful Output:
- Color-coded status indicators
- Clean, modern interface
- Multiple display modes (dynamic, static, chart-only)
Installation
From crates.io
From source
The binaries will be in target/release/:
pingmon(line chart)pingmon-bar(bar chart)
Usage
Basic Usage
# Ping Google DNS with line chart
# Ping specific host with bar chart
# Ping with custom interval
Command Line Options
USAGE:
pingmon [OPTIONS] [HOST]
pingmon-bar [OPTIONS] [HOST]
ARGS:
<HOST> Target host to ping [default: 8.8.8.8]
OPTIONS:
-H, --height <HEIGHT> Chart height [default: 15 for pingmon, 12 for bar]
-W, --width <WIDTH> Chart width (0 = auto) [default: 0]
-i, --interval <INTERVAL> Interval between pings (seconds) [default: 1.0]
-s, --static-mode Simple line-by-line output without chart
-c, --chart-only Only show chart and current status
-h, --help Print help information
-V, --version Print version information
Examples
# Ping with custom chart size
# Fast pinging (every 0.5 seconds)
# Static mode (no chart, just lines)
# Chart-only mode (minimal display)
# Tall bar chart
Display Modes
1. Dynamic Mode (Default)
Full-featured display with header, statistics, and chart.
=== Real-time Ping Monitor: 8.8.8.8 ===
Latency: 20.07 ms | TTL: 112 | Status: CONNECTED
Statistics:
Sent: 45 | Received: 45 | Lost: 0 (0.0%)
Min: 18.23ms | Avg: 20.15ms | Max: 25.67ms | StdDev: 1.45ms
Latency History (ms):
[ASCII chart here]
2. Static Mode (-s)
Simple line-by-line output, perfect for logging.
Pinging 8.8.8.8 ...
seq=1 20.07ms ttl=112 (loss=0.0% avg=20.07ms)
seq=2 19.85ms ttl=112 (loss=0.0% avg=19.96ms)
seq=3 21.34ms ttl=112 (loss=0.0% avg=20.42ms)
3. Chart-Only Mode (-c)
Minimal display with just status and chart.
Latency: 20.07 ms | TTL: 112 | Status: CONNECTED | Host: 8.8.8.8
Latency History (ms):
[ASCII chart here]
Chart Types
Line Chart (pingmon)
Latency History (ms):
25.0 ┤ ╭╮
20.0 ┤ ╭───╯╰─╮
15.0 ┼─╯ ╰─
10.0 ┤
Bar Chart (pingmon-bar)
Latency History (ms):
39.6 │ █ █
26.4 │█████████████
13.2 │█████████████
0.0 └──────────────
Requirements
- Operating System: Linux, macOS, or Windows
- Privileges:
- Linux/macOS: Requires
sudoorCAP_NET_RAWcapability - Windows: Run as Administrator
- Linux/macOS: Requires
Linux Capability Setup (Recommended)
Instead of using sudo every time, you can set the capability:
# After installation
How It Works
pingmon uses:
- surge-ping for efficient ICMP ping implementation
- rasciichart for beautiful ASCII line charts
- colored for terminal color output
- tokio for async runtime
- Custom bar chart rendering for filled graphs
The tool automatically:
- Detects terminal width and adjusts chart size
- Handles both IPv4 and IPv6 addresses
- Resolves hostnames to IP addresses
- Displays TTL (Time To Live) values
- Calculates comprehensive statistics
Stopping the Monitor
Press Ctrl+C to stop. Final statistics will be displayed:
✓ Stopped
Final Statistics:
Packets: Sent = 45, Received = 45, Lost = 0 (0.0%)
Latency: Min = 18.23ms, Avg = 20.15ms, Max = 25.67ms, StdDev = 1.45ms
Troubleshooting
Permission Denied
Linux/macOS:
# Option 1: Use sudo
# Option 2: Set capability (recommended)
Windows:
- Run Command Prompt or PowerShell as Administrator
Host Not Found
Make sure the hostname is correct:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
Author
Hadi Cahyadi - cumulus13@gmail.com
Changelog
v0.1.0 (Initial Release)
- Real-time ping monitoring with ASCII charts
- Two chart types: line and bar
- Comprehensive statistics
- Multiple display modes
- Auto terminal width detection
- TTL display
- Color-coded output
