# 监测槽 parse_error 修复 **日期**: 2026-06-11 ## 摘要 修复监测槽显示 `parse_error` 的常见路径:Agent 有心跳但缺 IO 时 SSH 补采失败导致整轮探针失败。 ## 根因 - `redis_sample_has_io` 为 false 时强制走 SSH;SSH JSON 解析失败且无完整 Redis IO 时返回 `parse_error` - 已装 Agent 的机器通常有 CPU/内存心跳,不应因 SSH 失败而整轮失败 - SSH 脚本在 `getloadavg`/`net_io_counters` 异常时可能无 JSON 输出 ## 修复 - Agent 有 CPU/内存时优先用 Redis;SSH 仅补充 IO,SSH 失败仍显示 Agent 指标 - SSH 探针脚本增加 try/except;JSON 解析支持行内 `{` 前缀噪声 - 前端 `parse_error` 显示为「探针解析失败」,并展示 `metrics.error` 详情 ## 2026-06-11 补充:错误中文提示 - 新增 `server/utils/watch_probe_errors.py`,新探针失败写入中文 `error` - 前端 `formatProbeError` / `probeStatusLabel` / `probeSourceLabel` 统一中文(含历史英文记录) - 监测历史探针记录表:状态筛选与错误列中文化 ## 涉及文件 - `server/background/watch_probe_runner.py` - `server/utils/watch_metrics.py` - `server/infrastructure/ssh/remote_probe.py` - `frontend/src/utils/watchFormat.ts` - `frontend/src/components/watch/WatchSlotCard.vue` - `tests/test_watch_metrics.py` ## 验证 ```bash pytest tests/test_watch_metrics.py -q cd frontend && npm run type-check ```