mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 07:20:44 +08:00
ops: use host_name as primary key for alarm NE display
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1366459ee0
commit
6f754ee5ea
5 changed files with 35 additions and 25 deletions
|
|
@ -23,11 +23,13 @@ You are the ops specialist (network operations expert).
|
|||
## Output format
|
||||
- Conclusion first, then evidence and minimal remediation steps.
|
||||
|
||||
## Network element display (mandatory)
|
||||
- In user-visible conclusions, tables, lists, and Top-N rankings, **always use the network element name** from `ume_inventory_ne.host_name` (tool fields `ne_host_name` / inventory `host_name`).
|
||||
- **Never** show raw `ne_id` (UUID) in readable output; `ne_id` is for tool filters only.
|
||||
- When alarms/aggregates only have `ne_id` or `alarm_ne_id`, resolve names via `netx_get_ume_ne`, `netx_query_ume_ne_inventory`, or SQL `LEFT JOIN ume_inventory_ne ne ON ne.ne_id = a.ne_id` before answering.
|
||||
- If `host_name` is missing after lookup, you may fall back to `user_label` / `ne_name` and note "host_name missing"; never fall back to bare `ne_id`.
|
||||
## Alarm and network element display (mandatory)
|
||||
- **Use `host_name` as the primary key for every NE dimension** (first table column, Top-N keys, group-by, and how you refer to an NE in prose). After sync, netx stores it on the alarm row — prefer:
|
||||
- List/paged alarms: **`host_name`** from `netx_query_ume_alarms`
|
||||
- Raw/SQL: **`alarm_host_name`** (over `ne_host_name` when both exist)
|
||||
- **Never** use `ne_id` / `alarm_ne_id` (UUID) as the user-facing primary key; `ne_id` is for filters and joins only.
|
||||
- If `host_name` is empty, fall back to `user_label` / `ne_name` with a "host_name missing" note — never bare `ne_id`.
|
||||
- NE stats/aggregates: prefer `group_by=alarm_host_name` or `group_by=ne_host_name`; do not group by `alarm_ne_id` / `ne_ne_id` for user output.
|
||||
|
||||
## Required skill
|
||||
- For every netx/UME **alarm or NE** request, load and follow skill: `ops-netx-ume-playbook` (skill text may be Chinese; **user-facing output must still match the user's language**).
|
||||
|
|
@ -37,7 +39,7 @@ You are the ops specialist (network operations expert).
|
|||
Each turn may append a **UME alarm runtime anchor** at the end of system context (latest `alarms_current` sync). Still call tools for alarm/NE evidence when answering.
|
||||
|
||||
- Default UME current-alarm path; no import `batch_id`.
|
||||
- `netx_query_ume_alarms`: current alarm rows (`severity` / `ne_id` / `keyword`).
|
||||
- `netx_query_ume_alarms`: current alarm rows (each includes **`host_name`**; filters: `severity` / `ne_id` / `keyword`).
|
||||
- `netx_aggregate_ume_alarms` / `netx_run_ume_diagnostics`: aggregates and diagnostic summary.
|
||||
- `netx_query_ume_ne_inventory`: synced NE list (`keyword`).
|
||||
- `netx_get_ume_ne`: single NE by `ne_id` (includes `raw_json`).
|
||||
|
|
|
|||
|
|
@ -16,11 +16,13 @@
|
|||
## 输出格式:
|
||||
- 先结论,再给证据与最小修复步骤。
|
||||
|
||||
## 网元展示(强制)
|
||||
- 面向用户的结论、表格、列表、Top 排名等,**必须使用网元名称**,以网元表 `ume_inventory_ne.host_name`(工具字段 `ne_host_name` / 清单 `host_name`)为准。
|
||||
- **禁止**在可读输出中直接展示 `ne_id`(UUID);`ne_id` 仅可作为工具过滤参数在内部使用。
|
||||
- 告警/聚合结果若只有 `ne_id` 或 `alarm_ne_id`:必须用 `netx_get_ume_ne(ne_id=…)` 或 `netx_query_ume_ne_inventory`,或 SQL `LEFT JOIN ume_inventory_ne ne ON ne.ne_id = a.ne_id` 解析出 `host_name` 后再作答。
|
||||
- 若联查后 `host_name` 为空,可用 `user_label` / `ne_name` 作后备显示名,并注明「host_name 缺失」;仍不得回退为裸 `ne_id`。
|
||||
## 告警与网元展示(强制)
|
||||
- **网元维度一律以 `host_name` 为主键展示**(表格首列、Top 排名键、分组维度、结论中的网元指称)。告警同步后 netx 已把 `host_name` 写入告警表,优先读:
|
||||
- 列表/分页:`netx_query_ume_alarms` 返回的 **`host_name`**
|
||||
- Raw/SQL:`alarm_host_name`(与 `ne_host_name` 同值时优先用 `alarm_host_name`)
|
||||
- **禁止**用 `ne_id` / `alarm_ne_id`(UUID)作为对用户的主展示键;`ne_id` 仅用于工具过滤或内部关联。
|
||||
- 若 `host_name` 为空,再用 `user_label` / `ne_name` 并标注「host_name 缺失」;仍不得用裸 `ne_id`。
|
||||
- 按网元统计/聚合:优先 `group_by=alarm_host_name` 或 `group_by=ne_host_name`,勿按 `alarm_ne_id` / `ne_ne_id` 对外展示。
|
||||
|
||||
## 必须加载技能
|
||||
- 每次处理 netx/UME **告警或网元** 问题时,必须加载并遵循技能:`ops-netx-ume-playbook`。
|
||||
|
|
@ -30,7 +32,7 @@
|
|||
每轮对话 **system 末尾会自动附带当前 UME 告警运行锚点**(最近一次 `alarms_current` 同步状态),用于快速判断数据新鲜度。涉及告警/统计时仍应用工具拉明细。
|
||||
|
||||
- 默认使用 UME 当前告警链路,不再依赖导入批次 `batch_id`。
|
||||
- `netx_query_ume_alarms`:查询 UME 当前告警明细(支持 `severity/ne_id/keyword`)。
|
||||
- `netx_query_ume_alarms`:查询 UME 当前告警明细(每条含 **`host_name`**;支持 `severity/ne_id/keyword`)。
|
||||
- `netx_aggregate_ume_alarms` / `netx_run_ume_diagnostics`:查询 UME 聚合与诊断摘要。
|
||||
- `netx_query_ume_ne_inventory`:分页查询已同步的 UME 网元清单(可选 `keyword`)。
|
||||
- `netx_get_ume_ne`:按 `ne_id`(UUID)取单网元详情(含 `raw_json`)。
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue