#ping #icmp #monitor #axum #latency

app ltping

A long-term ping monitor with a web-based dashboard

1 unstable release

Uses new Rust 2024

0.1.0 Feb 3, 2026

#3 in #latency

MIT license

18KB
340 lines

ltping - Long-term Ping Monitor

ltping is a Rust-based command-line utility for monitoring network connectivity over extended periods. Unlike standard ping, it aggregates statistics over configurable sliding time windows (e.g., last 10 seconds, 1 minute, 1 hour), providing a real-time dashboard of network health.

Features

  • Real-time Dashboard: Updates a TUI-like display with current network status.
  • Sliding Windows: Tracks statistics for multiple time intervals simultaneously (default: 10s, 30s, 60s).
  • Detailed Metrics:
    • Packet Loss %
    • RTT (Round Trip Time): Min, Max, Average
    • Jitter estimation
  • Visual Feedback: Color-coded output to quickly identify network degradation (high latency, jitter, or loss).
  • Raw Sockets: Uses ICMP echo requests directly (no external ping command dependency).

Prerequisites

  • Rust Toolchain: Install Rust
  • Linux/Unix: The application relies on raw sockets.

Build

cargo build --release

The binary will be available at target/release/ltping.

Usage

Permissions

Because ltping uses raw ICMP sockets, it requires special permissions. You have two options:

  1. Run as root:

    sudo ./target/release/ltping google.com
    
  2. Allow unprivileged ping (Recommended): Configure your system to allow your user group to create ICMP sockets.

    sudo sysctl -w net.ipv4.ping_group_range='0 2147483647'
    

    Note: This setting resets on reboot unless added to /etc/sysctl.conf.

Basic Command

# Ping a host with default settings
cargo run --release -- google.com

Advanced Usage

# Monitor 1.1.1.1 with windows for 10s, 1m, and 5m
cargo run --release -- 1.1.1.1 -w 10s 1m 5m

# Faster interval (0.5s) and shorter timeout (1s)
cargo run --release -- 8.8.8.8 -i 0.5 -t 1.0

Options

  • TARGET: Hostname or IP address to ping.
  • -w, --windows <WINDOWS>...: Time windows to track (e.g., 10s, 1m, 1h).
  • -i, --interval <SECONDS>: Seconds between pings (default: 1.0).
  • -t, --timeout <SECONDS>: Seconds to wait for a reply (default: 2.0).
  • --no-color: Disable colored output.

Development

  • Build: cargo build
  • Check: cargo check
  • Lint: cargo clippy

Dependencies

~14–30MB
~319K SLoC