cognis-digital/alertmux

GitHub: cognis-digital/alertmux

一款自托管的 AIOps 告警预处理工具,在告警到达 Grafana/PagerDuty 之前完成去重、关联和路由以降低告警噪声。

Stars: 0 | Forks: 0

ALERTMUX # ALERTMUX ### Grafana / PagerDuty 前端的告警去重、关联与路由 [![PyPI](https://img.shields.io/pypi/v/cognis-alertmux.svg?color=6b46c1)](https://pypi.org/project/cognis-alertmux/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/e7d133cfc4073030.svg)](https://github.com/cognis-digital/alertmux/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *DevOps 与可观测性 — 状态、合成检测、告警和云成本。*
``` pip install cognis-alertmux alertmux scan . # → prioritized findings in seconds ``` ## 使用说明 — 分步指南 `alertmux` 是轻量级 AIOps 告警处理工具:它负责对原始告警进行去重、关联,并将其路由转化为事件。 1. **安装** (Python 3.10+): pip install -e . # 或:pipx install alertmux 2. **运行完整流程**(去重 + 关联 + 路由)处理原始告警文件: alertmux mux demos/01-basic/alerts.json 3. **使用自定义路由规则**和关联窗口: alertmux mux alerts.json --rules rules.json --format json alertmux rules --rules rules.json # 打印当前生效的规则 4. **仅查看降噪(去重)桶**,包括来自标准输入(stdin)的内容: cat alerts.json | alertmux dedup - 5. **在 CI / pipeline 中读取输出** — JSON 格式的 `summary` 会报告 `incidents`、`paging` 和 `noise_reduction_pct`: alertmux mux alerts.json --format json | jq '.summary.noise_reduction_pct' ## 目录 - [为什么选择 alertmux?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献](#contributing) ## 为什么选择 alertmux? 轻量级 AIOps `alertmux` 是单一用途、可脚本化且支持自托管的:将其指向目标,以你的工作流已有的格式(table · JSON · SARIF)获取优先级排序的结果,在 CI 中设置门禁,并允许 agent 通过 MCP 驱动它。
↑ 返回顶部
## 功能 - ✅ 加载告警 - ✅ 加载规则 - ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行 - ✅ 提供 Python, JavaScript, Go 和 Rust 版本 (`ports/`)
↑ 返回顶部
## 快速开始 ``` pip install cognis-alertmux alertmux --version alertmux scan . # scan current project alertmux scan . --format json # machine-readable alertmux scan . --fail-on high # CI gate (non-zero exit) ```
↑ 返回顶部
## 示例 ``` $ alertmux scan . [HIGH ] ALE-001 example finding (./src/app.py) [MEDIUM ] ALE-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 返回顶部
## 架构 ``` flowchart LR IN[input] --> P[alertmux
analyze + score] P --> OUT[report] ```
↑ 返回顶部
## 从任何 AI 技术栈中使用 `alertmux` 可以与所有流行的 AI 使用方式互操作: - **MCP 服务器** — `alertmux mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **OpenAI 兼容 / JSON** — 将 `alertmux scan . --format json` 管道传输给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI pipeline 提供 exit code + SARIF
↑ 返回顶部
## 对比 | | **Cognis alertmux** | Keep | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 适用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生支持(AI agent) | ✅ | ❌ | | 多语言端口(JS/Go/Rust) | ✅ | ❌ | | 开放许可协议 | ✅ COCL | 视情况而定 | *秉承 **Keep** 的精神打造,以 Cognis 的方式重新构建。如有漏掉的致谢?欢迎提交 PR。*
↑ 返回顶部
## 集成 接入你的技术栈:用于代码扫描的 **SARIF**,适用于任何场景的 **JSON**,用于 AI agent 的 **MCP 服务器**(`alertmux mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。请参阅 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 返回顶部
## 安装 — 全平台、全方式 ``` pip install "git+https://github.com/cognis-digital/alertmux.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/alertmux.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/alertmux.git" # uv pip install cognis-alertmux # PyPI (when published) docker run --rm ghcr.io/cognis-digital/alertmux:latest --help # Docker brew install cognis-digital/tap/alertmux # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/alertmux/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | 云平台 | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/alertmux` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 返回顶部
## 相关 Cognis 工具 - [`statuskit`](https://github.com/cognis-digital/statuskit) — 自托管状态页面,包含事件时间线和订阅者 - [`probesite`](https://github.com/cognis-digital/probesite) — 合成可用性与 Playwright 检查,导出到 Prometheus - [`cloudbill`](https://github.com/cognis-digital/cloudbill) — 多云成本报告、异常检测和 FOCUS 导出 - [`k8scost`](https://github.com/cognis-digital/k8scost) — Kubernetes 成本与资源规格优化顾问,无 Prometheus 依赖 - [`otelbox`](https://github.com/cognis-digital/otelbox) — 一键式 OpenTelemetry collector + dashboard 套件 **探索完整套件 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 返回顶部
## 互操作性 `{}` 与包含 300+ 工具的 Cognis 套件无缝组合 — 统一的 JSON 输入/输出以及共享的 OpenAI 兼容 `/v1` 主干。请参阅 **[INTEROP.md](INTEROP.md)** 获取 套件图谱、组合模式和参考技术栈。 ## 许可协议 在 **Cognis Open Collaboration License (COCL) v1.0** 下开源可用 — 个人、内部评估、研究和教育用途免费;**商业/生产用途需要获得许可** (licensing@cognis.digital)。详见 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中的 170+ 工具之一 · 让明天更美好
标签:AIOps, Grafana, PagerDuty, Python, 可视化界面, 告警关联, 告警去重, 数据可视化, 无后门, 日志审计, 请求拦截, 运维监控, 逆向工具