Files
ykxmz/_build/rp_state_check.sh
T
xmz7891 490adbdba3 补充 2 小时长测的最终数据(361 样本 / 1 小时 44 分)
可用率 356/361 = 98.61%
    耗时   最小 829  中位 1280  P90 2386  P99 14242

长测原定 2 小时,实际跑到 1 小时 44 分停了 ——
设备在 19:11 换网段(192.168.10.105 -> 192.168.2.156),
测量脚本随之断开。361 个样本足够说明问题。

改之前是 96~98%,现在 98.61%,且失败不集中在某个时段。
2026-10-07 20:29:58 +08:00

50 lines
2.0 KiB
Bash

#!/bin/bash
# 换网段后确认状态
set -u
echo "════════ 1. 本机网络 ════════"
ip -br addr 2>/dev/null | sed 's/^/ /'
echo " 到网关: $(ip route 2>/dev/null | grep default | head -1)"
echo
echo "════════ 2. 中转/隧道/看门狗 ════════"
echo " relay: $(systemctl is-active lanremote-relay)"
echo " tunnel: $(systemctl is-active lanremote-tunnel)"
echo " tunnel-h2:$(systemctl is-active lanremote-tunnel-h2)"
echo " watchdog: $(systemctl is-active lanremote-watchdog.timer)"
echo
echo "════════ 3. 当前配比 ════════"
for svc in lanremote-tunnel lanremote-tunnel-h2; do
echo " $svc: $(systemctl cat $svc 2>/dev/null | grep -oE '\-\-metrics [0-9.:]+|\-\-protocol [a-z0-9]+|\-\-ha-connections [0-9]+' | tr '\n' ' ')"
done
echo " MTU: $(cat /sys/class/net/wlan0/mtu 2>/dev/null)"
echo " 连接: quic=$(curl -s --max-time 5 http://127.0.0.1:20241/metrics 2>/dev/null | grep ha_connections | awk '{print $2}') http2=$(curl -s --max-time 5 http://127.0.0.1:20242/metrics 2>/dev/null | grep ha_connections | awk '{print $2}')"
echo
echo "════════ 4. 公网通不通 ════════"
for i in 1 2 3; do
c=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 -H 'User-Agent: LanRemote/1.8.2' https://relay.xxmxxs.top/v1/health)
echo " 第 $i 次: $c"
sleep 1
done
echo
echo "════════ 5. 之前的长测数据还在不在 ════════"
for f in /root/long2h_health.tsv /root/long2h_conns.tsv /root/rp_poll30.tsv; do
if [ -f "$f" ]; then
echo " $f: $(wc -l < "$f") 行 最后修改 $(stat -c %y "$f" | cut -d. -f1)"
else
echo " $f: 不存在"
fi
done
echo
echo "════════ 6. 还在跑的测试进程 ════════"
pgrep -af 'rp_long2h|rpp30|rp_ab_long' | sed 's/^/ /' || echo " (没有)"
echo
echo "════════ 7. 设备内存/负载 ════════"
free -m | sed 's/^/ /'
uptime | sed 's/^/ /'