360 Secure SkillHub
360 安全技能中心

Ping

核心功能涵盖主机连通性检查、路由追踪、子网扫描、持续监控、延迟分析、多主机对比,及历史记录管理、配置修改。适用于排查网络故障、检测主机可达性、分析延迟问题等场景。通过bash脚本+环境变量传参,输出终端结果或CSV/JSON文件,历史数据本地存为JSONL格式。

xueyetianya
xueyetianya
热度 62.24
最近更新 2026-05-11 17:33:34
分类:数据依赖:代码执行 / 读写文件应用场景:数据处理 / 报告撰写 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ping
Metadata
name
ping
version
1.0.0
description
Monitor network connectivity and diagnose latency issues using ping and traceroute. Use when troubleshooting network problems or checking host availability.
author
BytesAgain
homepage
https://bytesagain.com
source
https://github.com/bytesagain/ai-skills
tags
["network","ping","traceroute","latency","monitoring","connectivity","diagnostics"]

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

Variable Description Default
PING_TARGET Target host or IP address —
PING_TARGETS Comma-separated list of targets (for compare) —
PING_COUNT Number of ping packets to send 4
PING_TIMEOUT Timeout in seconds per packet 5
PING_INTERVAL Seconds between pings (monitor mode) 5
PING_DURATION Total monitoring duration in seconds 60
PING_SUBNET CIDR notation subnet for sweep —
PING_LIMIT Max records to display in history 50
PING_FORMAT Export format: csv or json json
PING_OUTPUT Output file path for export stdout
PING_KEY Config key to set —
PING_VALUE Config 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