用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aaione/everything-claude-code-zh --skill network-interface-health命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Kubernetes 工作负载模式、资源管理、RBAC、probes、autoscaling、ConfigMap/Secret 处理,以及面向生产级部署的 kubectl 调试。
完成任何非平凡任务后使用。智能体按 5 个维度自评输出——准确性、完整性、清晰度、可执行性、简洁性——每项都给出具体证据。生成结构化 1-5 评分卡和具体改进建议。
在 competitive-platform-analysis 产出分层竞品集合后使用。按九个加权维度(定位、声音、视觉工艺、offer packaging、证据、enterprise-readiness、thought leadership、定价、客户 strategic tension)为每个竞品评分,使用明确 1–5 rubrics 和 tension-plot。位于 competitive-report-structure 之前。
基于 SOC 职业分类
正在显示 SKILL.md
| name | network-interface-health |
| description | 诊断路由器、交换机和 Linux 主机上的接口错误、丢包、CRC、双工不匹配、抖动、速度协商问题和计数器趋势。 |
| origin | community |
当网络症状可能由物理链路、交换机端口、电缆、收发器、双工设置或拥塞接口引起时使用此技能。
ifInErrors、ifOutErrors 或 ifOutDiscards。接口计数器是证据,但趋势比绝对数字更重要。捕获基线,等待测量间隔,再次捕获,然后比较增量。
show interfaces <interface>
show interfaces <interface> status
show logging | include <interface>|changed state|line protocol
在 Linux 主机上:
ip -s link show <interface>
ethtool <interface>
ethtool -S <interface>
| 计数器 | 含义 | 常见原因 |
|---|---|---|
| CRC | 接收帧校验和失败 | 坏电缆、脏光纤、坏光模块、双工不匹配 |
| input errors | 聚合接收端错误 | 在得出结论之前检查子计数器 |
| runts | 低于最小以太网大小的帧 | 双工不匹配、冲突域、故障网卡 |
| giants | 大于预期 MTU 的帧 | MTU 不匹配或巨型帧边界 |
| input drops | 设备无法接受入站数据包 | 突发、超额订阅、CPU 路径、队列压力 |
| output drops | 出站队列丢弃数据包 | 拥塞、QoS 策略、上行链路不足 |
| resets | 接口硬件重置 | 抖动、keepalive、驱动程序、光模块、电源 |
| collisions | 以太网冲突计数器 | 半双工或协商不匹配 |
在双方都支持的现代以太网链路上优先使用自动协商。如果一方必须固定,请在双方明确配置并记录原因。永远不要在一方混合固定速度/双工与另一方的自动。
show interfaces <interface> | include duplex|speed
将每个接口块从一个头部切片到下一个。不要使用任意字符窗口;大型接口块可能导致计数器丢失或分配给错误的端口。
import re
from typing import Any
HEADER_RE = re.compile(
r"^(?P<name>\S+) is (?P<status>(?:administratively )?down|up), "
r"line protocol is (?P<protocol>up|down)",
re.I | re.M,
)
ERROR_RE = re.compile(r"(?P<input>\d+) input errors, (?P<crc>\d+) CRC", re.I)
DROP_RE = re.compile(r"(?P<output>\d+) output errors", re.I)
DUPLEX_RE = re.compile(r"(?P<duplex>Full|Half|Auto)-duplex,\s+(?P<speed>[^,]+)", re.I)
def parse_show_interfaces(raw: str) -> list[dict[str, Any]]:
headers = list(HEADER_RE.finditer(raw))
interfaces = []
for index, header in enumerate(headers):
end = headers[index + 1].start() if index + 1 < len(headers) else len(raw)
block = raw[header.start():end]
errors = ERROR_RE.search(block)
drops = DROP_RE.search(block)
duplex = DUPLEX_RE.search(block)
interfaces.append({
"name": header.group("name"),
"status": header.group("status"),
"protocol": header.group("protocol"),
"duplex": duplex.group("duplex") if duplex else "unknown",
"speed": duplex.group().strip() duplex ,
: (errors.group()) errors ,
: (errors.group()) errors ,
: (drops.group()) drops ,
})
interfaces
network-troubleshooternetwork-config-validationhomelab-network-setup