alert-clinic

alert-clinic: An alert fault-diagnosis system that, upon receiving an alert, automatically performs three tasks: 1) collect alert context (extract alert details, host IP, agent IP, etc.); 2) remotely confirm if it is a false positive (run diagnostic commands on the target host to check metrics); 3) output a solution (diagnostic summary and self-healing script or recommendations). Dangerous actions (restarting services, deleting files, modifying configs) require prior consent and will never be executed silently.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "alert-clinic" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-257a172c35115c6966197b76d856d91a2ceaa70f7a0c09ff7f8f41fd27f3e2fb. Verify the upstream source and version against https://skillhub.cn/skills/org-3rlgh0jt/alert-clinic before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

alert-clinic: An alert fault-diagnosis system that, upon receiving an alert, automatically performs three tasks: 1) collect alert context (extract alert details, host IP, agent IP, etc.); 2) remotely confirm if it is a false positive (run diagnostic commands on the target host to check metrics); 3) output a solution (diagnostic summary and self-healing script or recommendations). Dangerous actions (restarting services, deleting files, modifying configs) require prior consent and will never be executed silently.

0 Downloads

Introduction source: third_party · org-3rlgh0jt · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: alert-clinic
description: |
  告警故障自动诊断技能:接收告警信息后自动收集上下文、远程确认是否误报、输出故障自愈脚本或解决方案。
  适用于:告警自动诊断、故障自愈、误报确认、运维自动化。
  触发场景:收到告警需分析根因、告警处理、故障排查与自愈方案生成。

告警故障自动诊断

执行流程

收到告警
  │
  ├─ 1. 获取告警上下文(告警详情、主机IP、代理IP)
  │
  ├─ 2. 远程执行诊断命令,确认是否误报
  │     ├─ 指标已恢复 → 误报,告知用户,结束
  │     └─ 指标仍异常 → 确认故障,继续
  │
  └─ 3. 输出诊断摘要 + 自愈脚本/解决方案
        └─ 危险操作前须征得用户同意

Step 1: 获取告警上下文

告警内容优先匹配格式

[监控类型] + 告警内容

  • 监控类型:用方括号包裹,位于标题最前面
  • 告警内容:紧跟在类型后面,必须包含具体的监控对象(如IP、主机名、服务名)和异常描述

提取规则(必须严格遵守)

  1. 完整性原则:告警内容必须完整,绝不可省略监控对象(如IP地址、主机名)。
  2. 方括号边界:以第一个 [ 开始,到告警内容最后一个关键描述词结束(如百分数、时长、状态值)。
  3. 排除问询词:标题结束于用户开始提问的位置。遇到“看下”“帮忙”“怎么回事”“处理一下”等提问意图词时,前面的内容才是标题。
  4. 从整句中定位:不要自己凭空拼接,必须从用户原句中连续截取。

示例(严格参考)

输入:告警诊断:[操作系统]192.168.3.75系统负载较高,超过3倍核心数 输出:[操作系统]192.168.3.75系统负载较高,超过3倍核心数

输入:[操作系统]192.168.3.75 CPU使用率持续10分钟大于95%,看下怎么回事 输出:[操作系统]192.168.3.75 CPU使用率持续10分钟大于95%

输入:帮忙看下[数据库]db-master-01 连接数超过阈值这个告警 输出:[数据库]db-master-01 连接数超过阈值

输入:[网络设备]10.0.0.1 端口down了,请问怎么办 输出:[网络设备]10.0.0.1 端口down了

输入:紧急,[应用服务]order-service 响应时间超过5秒,谁处理一下 输出:[应用服务]order-service 响应时间超过5秒

输入:有个问题[操作系统]192.168.3.75系统负载较高,超过3倍核心数,处理一下 输出:[操作系统]192.168.3.75系统负载较高,超过3倍核心数

输出格式

直接输出提取到的告警内容,不要添加任何解释。

告警信息查询工具

python3 skills/alert-clinic/scripts/problem_get.py \
  --keyword '[操作系统]itops-serverCPU总使用率大于3%' \

参数

参数 必填 说明
--keyword 是 告警内容

使用告警信息查询工具后收集关键信息:

参数名 类型 说明
description string 告警标题
comments string 告警描述
ip string IP地址
clock string 告警时间
priority_label string 告警等级
classification_label string 对象分类名称
subtype_label string 对象子类型名称
proxy_ip string 代理IP地址
status string 告警是否恢复

Step 2: 远程确认是否误报

2.1 提交脚本执行请求

使用脚本提交工具提交诊断命令:

python3 skills/alert-clinic/scripts/run_script_submit.py \
  --hosts '192.168.3.137' \
  --script_content "df -h" \
  --proxy_ip '192.168.3.17'

返回示例:

{
  "code": 0,
  "execution_id": 51134,
  "task_name": "脚本快速执行-20260702141756",
  "audit_id": 0
}

参数:

参数 必填 说明
--hosts 是 目标主机 IP,多个用逗号分隔
--script_content 是 脚本内容
--proxy_ip 否 跳板机/代理 IP
--script_type 否 脚本类型(1-5,默认1)
--task_name 否 任务名称

2.2 检查是否需要审核

如果 audit_id = 0(无需审核): → 直接进入步骤 2.4 查询执行结果

如果 audit_id > 0(需要审核): → 进入步骤 2.3 等待审核

2.3 等待审核通过(如需要)

提示用户:

检测到高危命令,需要人工审核。
审核 ID:224
请在系统中审核该脚本。

正在轮询审核状态...

调用审核详情工具(内部自动轮询):

python3 skills/alert-clinic/scripts/audit_detail.py \
  --audit_id 224

工具行为:

  • 自动轮询审核状态(智能间隔:2s → 5s → 10s)
  • 显示轮询进度(如 [审核轮询 #1] 待审核 (已用时 2.5s))
  • 超时时间:30 分钟(可在 config.json 配置)

返回示例(审核成功):

{
  "code": 0,
  "data": {
    "id": 224,
    "title": "脚本快速执行-20260702141756",
    "status": 1,
    "msg": ""
  }
}

返回示例(审核失败):

{
  "code": 1,
  "message": "审核失败:存在高危操作"
}

审核结果:

  • 退出码 0:审核成功,进入步骤 2.4
  • 退出码 1:审核失败,告知用户,结束流程

2.4 查询执行结果

通过 execution_id 查询:

python3 skills/alert-clinic/scripts/execution_result.py \
  --execution_id 51134

或通过 task_name 查询:

python3 skills/alert-clinic/scripts/execution_result.py \
  --task_name "脚本快速执行-20260702141756"

返回示例(可视化格式):

========== 脚本执行结果 ==========
任务 ID:51134
任务名称:脚本快速执行-20260702141756
执行用户:
作业 ID:453
执行状态:成功
开始时间:2026-07-02 14:17:58
结束时间:2026-07-02 14:18:01
执行耗时:3 秒

========== 输出详情 ==========

--- 脚本1 | 步骤1 | 成功 | 3s ---

主机:192.168.1.12 | 状态:成功
stdout:
Tue Jul  2 14:17:58 CST 2026

============================================================

参数:

参数 必填 说明
--execution_id 是* 任务 ID(与 --task_name 二选一)
--task_name 是* 任务名称(与 --execution_id 二选一)
--json 否 以 JSON 格式输出
--verbose 否 显示详细轮询信息

2.5 常用诊断命令

告警类型 命令
CPU 高 top -bn1 \| head -20
内存高 free -h && ps aux --sort=-%mem \| head -10
磁盘满 df -h && du -sh /* 2>/dev/null \| sort -rh \| head -10
网络异常 ss -s && ping -c 3 <网关IP>
服务停止 systemctl status <服务名>
进程僵死 ps aux \| grep <进程名>

根据返回结果判定:指标恢复→误报;仍异常→进入 Step 3。

Step 3: 输出解决方案

  1. 诊断摘要 — 故障现象 + 根因分析
  2. 自愈脚本 — 可通过脚本执行工具远程执行的修复命令(参考 Step 2)
  3. 危险操作确认 — 重启服务、删除文件、修改配置等须先征得用户同意

注意事项

  • 危险操作(重启、删除、修改配置)须征得用户同意

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 针对运维告警自动诊断这一明确场景,功能闭环完整
  • 有效解决运维人员高频痛点,具备显著实用价值
Trigger Precision90/100

Highlights

  • 告警内容格式定义清晰,提取规则具体可执行
  • 覆盖多种用户输入变体,边界明确
Structure and Standards88/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层frontmatter和skill_body内部均包含description内容

    Recommendation: 建议仅在顶层frontmatter保留description,skill_body内部可改为简介或删除重复内容

  • 缺少When to Use章节 Reported severity: Minor

    文档结构完整但缺少显式的When to Use使用场景说明

    Recommendation: 建议在Step 1前补充When to Use章节,明确适用场景

  • 文档过长 Reported severity: Minor

    当前文档约600行,超出建议的500行限制

    Recommendation: 建议精简部分重复说明或拆分为多个子章节

Highlights

  • 执行流程Phase划分清晰,步骤明确
  • 包含完整端到端示例,便于理解执行
Execution Reliability85/100

Highlights

  • 工具来源明确,参数说明完整
  • 覆盖审核流程与异常处理,危险操作有确认机制
Evidence Verifiability (mean of the first four)87/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.