← 返回
未分类 中文

Ping

Monitor network connectivity and diagnose latency issues using ping and traceroute. Use when troubleshooting network problems or checking host availability.
使用 ping 和 traceroute 监控网络连接并诊断延迟问题。用于排查网络故障或检查主机可用性。
xueyetianya xueyetianya 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 511
下载
💾 1
安装
1
版本
#latest

概述

Ping — Network Connectivity Tool

A thorough network connectivity diagnostic tool that checks host availability, traces routes, sweeps subnets, monitors uptime, and analyzes latency patterns. All results are stored locally in JSONL format for historical analysis and reporting.

Prerequisites

  • ping command (pre-installed on most systems)
  • traceroute or tracepath (for route tracing)
  • python3 (for data processing and reporting)
  • bash 4.0+

Data Storage

All ping results and configuration are stored in ~/.ping/:

  • ~/.ping/data.jsonl — historical ping results (JSONL format)
  • ~/.ping/config.json — user configuration (default count, timeout, etc.)

Commands

check

Check connectivity to a target host. Sends ICMP echo requests and records results.

PING_TARGET="8.8.8.8" PING_COUNT="4" bash scripts/script.sh check

trace

Trace the network route to a target host, showing each hop and latency.

PING_TARGET="google.com" bash scripts/script.sh trace

sweep

Sweep a subnet to discover responsive hosts. Scans a CIDR range.

PING_SUBNET="192.168.1.0/24" bash scripts/script.sh sweep

monitor

Continuously monitor a host and log results. Runs a configurable number of pings over time.

PING_TARGET="8.8.8.8" PING_INTERVAL="5" PING_DURATION="60" bash scripts/script.sh monitor

report

Generate a summary report from stored ping history for a specific target or all targets.

PING_TARGET="8.8.8.8" bash scripts/script.sh report

latency

Analyze latency statistics (min, max, avg, jitter, percentiles) for a target.

PING_TARGET="8.8.8.8" bash scripts/script.sh latency

compare

Compare connectivity and latency between multiple hosts side by side.

PING_TARGETS="8.8.8.8,1.1.1.1,208.67.222.222" bash scripts/script.sh compare

history

View stored ping history with optional filtering by target, date range, or status.

PING_TARGET="8.8.8.8" PING_LIMIT="20" bash scripts/script.sh history

export

Export ping history to CSV or JSON format.

PING_FORMAT="csv" PING_OUTPUT="ping_report.csv" bash scripts/script.sh export

config

View or update ping configuration (default count, timeout, interval).

PING_KEY="count" PING_VALUE="10" bash scripts/script.sh config

help

Show usage information and available commands.

bash scripts/script.sh help

version

Display the current version of the ping skill.

bash scripts/script.sh version

Environment Variables

VariableDescriptionDefault
---------
PING_TARGETTarget host or IP address
PING_TARGETSComma-separated list of targets (for compare)
PING_COUNTNumber of ping packets to send4
PING_TIMEOUTTimeout in seconds per packet5
PING_INTERVALSeconds between pings (monitor mode)5
PING_DURATIONTotal monitoring duration in seconds60
PING_SUBNETCIDR notation subnet for sweep
PING_LIMITMax records to display in history50
PING_FORMATExport format: csv or jsonjson
PING_OUTPUTOutput file path for exportstdout
PING_KEYConfig key to set
PING_VALUEConfig value to set

Examples

# Quick connectivity check
PING_TARGET="google.com" bash scripts/script.sh check

# Monitor DNS server for 5 minutes
PING_TARGET="8.8.8.8" PING_INTERVAL="10" PING_DURATION="300" bash scripts/script.sh monitor

# Compare DNS providers
PING_TARGETS="8.8.8.8,1.1.1.1,9.9.9.9" bash scripts/script.sh compare

# Export last week's data as CSV
PING_FORMAT="csv" bash scripts/script.sh export

Powered by BytesAgain | bytesagain.com | hello@bytesagain.com

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 13:53 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Shell

xueyetianya
Shell脚本参考:涵盖Bash语法、重定向、进程替换、信号处理及调试技巧。适用于编写Shell脚本和故障排查。
★ 1 📥 6,181
productivity

Task Planner

xueyetianya
Manage tasks, set priorities, and track deadlines locally. Supports bilingual (EN/CN) documentation. 支持个人任务管理、优先级设定及到期提醒
★ 2 📥 4,310
content-creation

Vision

xueyetianya
使用 ImageMagick 对图像进行缩放、裁剪、格式转换和优化。适用于处理照片、转换格式(PNG/WebP)、压缩大小或添加水印。
★ 1 📥 4,716