Auto-sync: 2026-04-27 00:02

This commit is contained in:
2026-04-27 00:02:56 +08:00
parent 997e25aae6
commit 23bef113dd
30 changed files with 1454 additions and 1037 deletions

View File

@@ -1,75 +1,52 @@
---
title: "Alertmanager"
type: entity
aliases: [Prometheus Alertmanager, Alertmanager OSS]
tags: [alerting, prometheus, notification, devops, observability]
date: 2025-11-11
---
# Alertmanager
## Overview
Alertmanager 是 Prometheus 生态系统中的告警分发和路由组件。当 Prometheus 的告警规则触发时,告警被发送给 Alertmanager由 Alertmanager 负责抑制inhibition、分组grouping、静默silencing和路由routing到最终的通知通道邮件、Slack、PagerDuty、WeChat 等)。
## Key Characteristics
- **告警分组**:将相似告警合并为一条通知,避免告警风暴
- **抑制机制**:当一个严重告警触发时,自动抑制相关的次要告警
- **静默规则**:基于时间窗口的告警静默,支持重复告警抑制
- **多通道路由**邮件、Slack、WeChat、Telegram、PagerDuty、Webhook
- **重复间隔**:未解决的告警按可配置间隔重复发送
## Prometheus Configuration
```yaml
# prometheus.yml
alerting:
alertmanagers:
- static_configs:
- targets: ['alertmanager:9093']
```
## Alertmanager Configuration
```yaml
# alertmanager/config.yml
global:
resolve_timeout: 5m
route:
receiver: default
group_wait: 10s # 新告警等待 10s 再发送(收集同组告警)
group_interval: 5m # 告警组更新间隔
repeat_interval: 3h # 重复告警间隔
receivers:
- name: default
email_configs:
- to: "youremail@example.com"
from: "monitor@example.com"
smarthost: "smtp.example.com:587"
auth_username: "monitor@example.com"
auth_password: "yourpassword"
# Slack 配置示例
slack_configs:
- api_url: 'https://hooks.slack.com/services/xxx'
channel: '#alerts'
```
## Alertmanager vs Grafana Alerting
| 维度 | Alertmanager | Grafana Alerting |
|------|-------------|-----------------|
| 数据源 | Prometheus 原生 | 多数据源 |
| 告警规则 | Prometheus YAML | Grafana UI / YAML |
| 通知通道 | 原生多通道 | 原生 + 插件扩展 |
| 告警历史 | 需额外存储 | 内置告警历史 |
| 适用场景 | 标准化告警 | 仪表盘联动告警 |
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Entities
- [[Prometheus]] — 告警规则源和发送方
- [[Grafana]] — 可替代 Prometheus Alerting 的告警方案
## Related Concepts
- [[Prometheus告警规则]] — 告警条件定义
- [[PromQL]] — 告警触发条件语言
- [[System Monitoring]] — 上游应用领域
---
title: "Alertmanager"
type: entity
tags: [monitoring, alerting, prometheus, devops]
last_updated: 2026-04-26
---
## Alertmanager — Prometheus 告警分发组件
**官方网址:** https://prometheus.io/docs/alerting/latest/alertmanager/
**类型:** 开源项目 / 告警分发系统
**别名:**
- prometheus-alertmanager
- Alertmanager
---
## Overview
Alertmanager 是 Prometheus 生态中的告警分发组件,负责接收 Prometheus Server 发送的告警进行抑制inhibition、分组grouping处理后路由到邮件、Slack、PagerDuty、webhook 等通知渠道。
**核心功能:**
- **抑制Inhibition** 当某条告警触发时,自动抑制相关联的其他告警
- **分组Grouping** 将相似告警合并为一条通知,减少告警风暴
- **静默Silence** 临时屏蔽特定告警
- **路由Routing** 基于标签匹配将告警路由到不同接收人
**配置格式:** YAML 格式的 `config.yml`
**典型部署:**
- Docker: `prom/alertmanager:latest`
- 端口:`9093`
- Prometheus 配置中通过 `alerting.alertmanagers` 指定 targets
**支持的通知渠道:**
- Email
- Slack
- PagerDuty
- OpsGenie
- WeChat
- Telegram
- Webhook通用 HTTP
---
## Used By
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]

View File

@@ -0,0 +1,53 @@
---
title: "Blackbox Exporter"
type: entity
tags: [monitoring, prometheus, blackbox, probe, devops]
last_updated: 2026-04-26
---
## Blackbox Exporter — Prometheus 黑盒探测 exporter
**官方网址:** https://prometheus.io/docs/guides/node-exporter/
**类型:** 开源项目 / Prometheus Exporter
**别名:**
- blackbox_exporter
- prometheus blackbox
---
## Overview
Blackbox Exporter 是 Prometheus 官方提供的黑盒探测 exporter通过 HTTP、HTTPS、DNS、TCP、ICMP 等协议探测目标端点的可用性、响应时间和 TLS 证书状态,支持细粒度的服务层监控。
**支持模块:**
- `http_2xx` — HTTP/HTTPS 可用性探测
- `https_2xx` — 仅 HTTPS 探测
- `dns` — DNS 解析探测
- `tcp` — TCP 端口探测
- `icmp` — ICMP ping 探测
**采集指标示例:**
- `probe_success` — 探测是否成功0/1
- `probe_duration_seconds` — 探测耗时(秒)
- `probe_ssl_earliest_cert_expiry` — TLS 证书到期时间戳
- `probe_http_status_code` — HTTP 响应码
- `probe_dns_lookup_duration_seconds` — DNS 解析耗时
**典型部署:**
- Docker: `prom/blackbox-exporter:latest`
- 端口:`9115`
- Prometheus 配置需使用 `metrics_path: /probe``params: module: [http_2xx]`
**关键告警规则示例:**
- 站点不可达: `probe_success == 0`(持续 2 分钟)
- TLS 证书到期: `probe_ssl_earliest_cert_expiry - time() < 86400 * 14`(剩余 < 14 天)
---
## Used By
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]

View File

@@ -1,59 +1,47 @@
---
title: "Grafana"
type: entity
aliases: [Grafana OSS, Grafana Labs]
tags: [visualization, dashboard, monitoring, observability, grafana]
date: 2025-11-11
---
# Grafana
## Overview
Grafana 是开源的可视化和监控平台,由 Grafana Labs 开发和维护。它能连接多种数据源Prometheus、Loki、VictoriaMetrics、Elasticsearch、InfluxDB 等提供丰富的仪表盘模板、查询编辑器和告警管理功能。家庭监控方案中Grafana 通过 Dashboard ID 直接导入官方模板,快速搭建可视化界面。
## Key Characteristics
- **多数据源支持**Prometheus、Loki、VictoriaMetrics、Elasticsearch、MySQL、PostgreSQL 等
- **Dashboard 即代码**JSON 格式导出存储,纳入 Git 版本控制GitOps
- **官方 Dashboard 市场**Dashboard ID 直接导入1860Node Exporter Full、14282cAdvisor、7587Blackbox
- **告警管理**:原生告警支持,可替代 Prometheus Alerting 独立使用
- **变量和模板**:支持动态仪表盘、级联选择器
- **权限控制**组织Org、团队、用户三级权限体系
## Home Server Deployment
```yaml
# docker-compose.yml 片段
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_NAME=Main Org
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-storage:/var/lib/grafana
```
## Quick Dashboard Import
1. 访问 `http://localhost:3000`admin/admin 登录
2. 添加数据源:`http://prometheus:9090`
3. Dashboards → Import → 输入 Dashboard ID
- **1860** — Node Exporter Full主机指标
- **14282** — cAdvisor Container Metrics容器指标
- **7587** — Blackbox Exporter ProbeHTTP 探测)
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Entities
- [[Prometheus]] — 主要数据源
- [[Grafana Labs]] — 维护组织
- [[Alertmanager]] — 告警接收
## Related Concepts
- [[System Monitoring]] — 上游领域
- [[Centralized Logging]] — Grafana Loki 补充日志可视化
- [[Observability]] — 可观测性三大支柱之一(可视化层)
---
title: "Grafana"
type: entity
tags: [visualization, monitoring, dashboards, observability]
last_updated: 2026-04-26
---
## Grafana — 可视化与告警平台
**官方网址:** https://grafana.com/
**类型:** 开源项目 / 可视化平台
**别名:**
- Grafana OSS
- Grafana Labs
---
## Overview
Grafana 是开源的可视化和告警平台,支持从 Prometheus、VictoriaMetrics、Loki、InfluxDB、Elasticsearch 等多种数据源查询和展示时序数据,提供丰富的 Dashboard 模板和灵活的告警配置。
**核心特性:**
- 多数据源支持Prometheus、Elasticsearch、Loki、InfluxDB 等)
- Dashboard 即代码JSON 导出 + Git 管理)
- 告警规则配置(支持邮件/Slack/PagerDuty 等通知渠道)
- 用户权限管理
- 插件生态
**典型部署端口:** `3000`(默认 admin/admin
**常用 Dashboard ID**
- Node Exporter Full: `1860`
- cAdvisor Container Metrics: `14282`
- Blackbox Exporter Probe: `7587`
---
## Used By
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
- [[ctp-topic-60-monitor-aws-using-hyperscale-observability-with-grafana]]
- [[ctp-topic-42-grafana-observability-dashboard]]
- [[public-cloud-learning-sessions-observability-with-opentelemetry]]

View File

@@ -0,0 +1,47 @@
---
title: "Node Exporter"
type: entity
tags: [monitoring, exporter, prometheus, devops]
last_updated: 2026-04-26
---
## Node Exporter — Prometheus 主机指标采集器
**官方网址:** https://prometheus.io/docs/guides/node-exporter/
**类型:** 开源项目 / Prometheus Exporter
**别名:**
- prometheus-node-exporter
- node_exporter
---
## Overview
Node Exporter 是 Prometheus 官方提供的 exporter用于采集主机服务器/NAS/树莓派等)的硬件和操作系统指标。以 DaemonSet 或独立进程方式运行,采集 CPU、内存、磁盘、网络、文件系统等数据。
**采集指标示例:**
- `node_cpu_seconds_total` — CPU 使用时间
- `node_memory_MemAvailable_bytes` — 可用内存
- `node_memory_MemTotal_bytes` — 总内存
- `node_filesystem_avail_bytes` — 文件系统可用空间
- `node_network_receive_bytes_total` — 网络接收字节
- `node_load1` / `node_load5` / `node_load15` — 系统负载
**典型部署:**
- Docker: `prom/node-exporter:latest`,需 `network_mode: host` + volume 挂载 `/proc``/sys``/`
- 端口:`9100`
**关键告警规则示例:**
- 磁盘剩余 < 10%: `node_filesystem_avail_bytes / node_filesystem_size_bytes < 0.10`
- CPU 使用率 > 85%: `avg(rate(node_cpu_seconds_total{mode="user"}[2m])) * 100 > 85`
- 内存可用 < 15%: `node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes < 0.15`
---
## Used By
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]

View File

@@ -1,51 +1,31 @@
---
title: "OpenClaw"
type: entity
tags: [ai-agent, memory, context-management, framework]
last_updated: 2026-04-23
---
## Overview
开源多 Agent 框架358k stars。以 plain markdown 文件为核心记忆架构无隐藏状态Agent 读什么写什么,完全透明。
## Architecture
### Core Files
- `MEMORY.md` — 长期记忆存储
- `YYYY-MM-DD.md` — 每日运行上下文笔记
- `DREAMS.md` — 整合摘要dreaming 进程的产出)
### Dreaming Cycle三阶段背景整合
OpenClaw 的核心创新——夜间后台进程将每日笔记整合为长期记忆:
1. **Light Sleep**:筛选每日笔记,将相邻行分组为连贯块
2. **REM**:基于访问频率加权提升——频繁访问的信息成为"持久真理"
3. **Deep Sleep**:安全晋升到 MEMORY.md执行合并而非重复
**评分门控**:进入长期记忆需通过六个加权信号:
- 相关性0.30
- 频率0.24
- 查询多样性0.15
- 时效性0.15
- 整合度0.10
- 概念丰富度0.06
阈值要求:分数 ≥ 0.8 + 访问次数 ≥ 3 + 独立查询数 ≥ 3
### 与 Camp 1 的本质区别
Camp 1Mem0 等):对话 → 提取事实 → 存入向量库 → 检索召回
OpenClawAgent 读取结构化上下文 → 在上下文中工作 → 写回文件 → 上下文自然复合增长
核心哲学:**"The model only 'remembers' what gets saved to disk, there is no hidden state."**
## Aliases
- OpenClaw
- openclaw
## Connections
- [[OpenClaw]] ← implements ← [[Context Substrate]]Camp 2 的典型代表)
- [[Second Brain]] ← uses ← [[OpenClaw]]
- [[Personal Knowledge Base (RAG)]] ← uses ← [[OpenClaw]]
- [[semantic-memory-search]] ← extends ← [[OpenClaw]]MemSearch 为 Markdown 记忆添加语义搜索)
- [[Self-Improving-Skill]] ← integrates_with ← [[OpenClaw]]
- [[multi-channel-assistant]] ← based_on ← [[OpenClaw]]
---
title: "OpenClaw"
type: entity
tags: [ai-agent, memory, workflow]
sources: [万字讲透openclaw-workspace深度解析-2026-03-21, 养龙虾5天血泪史-我的ai-agent为什么总失忆-openclaw-记忆调试全记录, 养虾日记2-让agent更懂你-openclaw-self-improving-复盘实战案例分享, 养虾日记1-我用-openclaw-管了-28-万张照片-一次真实的多设备照片整理实战, 养虾日记3-用-obsidian-gitea-为-ai-助手构建持久化笔记系统, macos-创建与解除-symbolic-link-openclaw-目录映射]
last_updated:
---
## Overview
OpenClaw 是一个具有持久记忆能力的 AI Agent 管理框架,默认使用隐藏目录 `~/.openclaw` 存储记忆、Skills、Prompts、日志等数据。支持通过符号链接将隐藏目录映射为可见目录`~/openclaw`),以便 Finder 或 Obsidian 直接访问。
## Aliases
- OpenClaw Workspace
- OpenClaw Agent Framework
## Key Characteristics
- **持久记忆**:三层记忆架构(短期文件 + 长期向量数据库 + self-improving 复盘
- **多渠道入口**Telegram / Discord / SMS / 电话等
- **n8n 工作流编排**:支持复杂工作流自动化
- **符号链接支持**:通过 `ln -s ~/.openclaw ~/openclaw` 实现目录可见化
## Related Entities
- [[Obsidian]]:与 OpenClaw 通过 SymbolicLink 共用数据目录
- [[HermesAgent]]:同类 AI Agent 框架
- [[n8n]]OpenClaw 的工作流编排集成
## Related Concepts
- [[SymbolicLink]]OpenClaw 目录可见化的核心技术
- [[Self-Improving-Skill]]OpenClaw 的自改进机制
- [[SecondBrain]]OpenClaw 构建的个人第二大脑

View File

@@ -1,63 +1,44 @@
---
title: "Prometheus"
type: entity
aliases: [Prometheus OSS, Prometheus监控]
tags: [monitoring, observability, time-series, alerting, prometheus]
date: 2025-11-11
---
# Prometheus
## Overview
Prometheus 是 CNCF 毕业的开源系统监控和告警工具包,最初由 SoundCloud 开发现已广泛用于云原生和家居服务器环境。作为时序数据库Prometheus 通过 pull 模式定期从已配置的 targets 抓取指标数据,支持强大的 PromQL 查询语言和灵活的告警规则引擎。
## Key Characteristics
- **Pull 模式**Prometheus 服务器定期从各 exporter 的 HTTP `/metrics` 端点拉取指标,无需在被监控主机安装代理
- **PromQL**:强大的查询语言,支持聚合、函数、即时向量和范围向量查询
- **告警规则**:基于 PromQL 表达式定义告警条件,触发后发送给 Alertmanager
- **多数据出口**:支持 Remote Write 远端写入VictoriaMetrics/Thanos/Cortex、Grafana 可视化
- **服务发现**:支持 Kubernetes、Consul、静态配置等多种发现机制
## Home Server Deployment
```yaml
# docker-compose.yml 片段
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./prometheus/alerts.yml:/etc/prometheus/alerts.yml:ro
ports:
- "9090:9090"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.enable-lifecycle'
```
## Core Metrics Types
| 类型 | 示例 | 说明 |
|------|------|------|
| Gauge | `node_memory_MemAvailable_bytes` | 可增可减的当前值 |
| Counter | `node_cpu_seconds_total` | 只增不减的累计值 |
| Histogram | `prometheus_http_request_duration_seconds_bucket` | 分布统计 |
| Summary | `go_gc_duration_seconds` | 分位数统计 |
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Entities
- [[Grafana]] — 可视化层
- [[Alertmanager]] — 告警分发
- [[node_exporter]] — 主机指标采集
- [[cAdvisor]] — 容器指标采集
- [[blackbox_exporter]] — HTTP/TCP 探测
- [[Uptime Kuma]] — 合成监控(互补)
## Related Concepts
- [[PromQL]] — Prometheus 查询语言
- [[Prometheus告警规则]] — 告警条件定义
- [[Exporter]] — 指标暴露组件
- [[时序数据库]] — 数据存储模式
- [[System Monitoring]] — 上游领域
- [[Centralized Logging]] — 可互补的日志聚合方案
---
title: "Prometheus"
type: entity
tags: [monitoring, time-series, devops, observability]
last_updated: 2026-04-26
---
## Prometheus — 开源监控系统与时序数据库
**官方网址:** https://prometheus.io/
**类型:** 开源项目 / 监控系统
**别名:**
- prom
- Prometheus TSDB
---
## Overview
Prometheus 是由 SoundCloud 开发的开源监控系统,现由 CNCF 托管。采用**拉取pull模式**从配置的 targets 收集指标,存储为时间序列数据,支持强大的 PromQL 查询语言和灵活的告警规则引擎。
**核心特性:**
- 多维数据模型metric + labels
- PromQL 强大查询能力
- 拉取模式优于推送(网络可控、无侵入)
- HTTP API易于集成
- Alertmanager 集成
**典型部署端口:** `9090`Web UI + API
---
## Used By
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
- [[家庭网络环境概览_2026-04-03]]
- [[ctp-topic-8-implementation-of-cloud-monitoring-using-micro-focus-operations-brid]]
- [[ctp-topic-60-monitor-aws-using-hyperscale-observability-with-grafana]]
- [[ctp-topic-67-cloud-native-observability-using-opentelemetry]]
- [[public-cloud-learning-sessions-observability-with-opentelemetry]]

View File

@@ -0,0 +1,35 @@
---
title: "Synology DSM"
type: entity
tags: [synology, nas, dsm, linux, docker]
date: 2026-05-14
---
# Synology DSM
## Aliases
- Synology DSM
- DSM
- DSM 7.x
- 群晖 DSM
## Definition
Synology DiskStation ManagerDSM是群晖 NAS 设备的操作系统,基于 Linux 内核,提供图形化 Web 管理界面。本文档中的部署环境为 DSM 7.xDS718Docker 服务名称为 `pkg-ContainerManager-dockerd`
## Key Characteristics for Home Server Context
- **Docker 服务名**`pkg-ContainerManager-dockerd`(与标准 Linux 的 `dockerd` 不同)
- **systemd 配置目录**`/etc/systemd/system/pkg-ContainerManager-dockerd.service.d/`(用于配置 Docker Daemon 代理)
- **IP 地址**:典型内网地址 `192.168.3.17`
- **QuickConnect**:群晖远程访问服务,可作为透明代理失效时的备用连接方案
## Known Quirks
- Docker Daemon 的网络栈不完全遵循 V2RayA 修改的 iptables 规则,需要显式配置 systemd 代理环境变量
- 透明代理有极小概率导致局域网连接中断,远程操作时需谨慎
## Related Sources
- [[群晖NAS科学上网方法]] — V2RayA 透明代理 + Docker Daemon 代理配置
- [[Synology-NAS上安装CloudDrive2]] — CloudDrive2 套件安装
## Related Entities
- [[Synology-NAS]] — Synology NAS 硬件设备
- [[Docker]] — DSM 上的核心容器化平台

View File

@@ -15,6 +15,11 @@ date: 2026-04-28
## Definition
Synology NAS网络附加存储是由群晖科技生产的私有云存储设备提供文件存储、备份、多媒体服务等功能。在 Home Office 架构中是核心数据存储节点,通过 NFS 或 Samba 协议向 Ubuntu 服务器提供备份存储空间。
## Docker 套件
- V2RayA透明代理 + Docker Daemon 代理):通过 Docker 部署,为 NAS 本机和 Docker pull 提供科学上网能力
- CloudDrive2云盘挂载矿神源安装
- PortainerDocker 容器可视化管理
## Core Capabilities
- **NFS 共享**:通过 DSM 控制面板启用 NFS 服务配置导出路径和访问权限IP 白名单、Squash 设置)
- **SMB/CIFS 共享**:通过 Samba 协议向 Windows/macOS 机器提供文件共享

47
wiki/entities/V2RayA.md Normal file
View File

@@ -0,0 +1,47 @@
---
title: "V2RayA"
type: entity
tags: [vpn, proxy, transparent-proxy, docker, v2ray, open-source]
date: 2026-05-14
---
# V2RayA
## Aliases
- V2RayA
- v2raya
- V2rayA
## Definition
V2RayA 是基于 V2Ray 内核的轻量级透明代理 Web 管理界面,支持通过 Docker 部署在 NAS/服务器环境中,提供可视化的节点管理、分流规则配置和透明代理开关功能。
## Core Capabilities
- **Web UI 管理**:通过浏览器配置代理节点、路由规则和透明代理开关
- **透明代理**:劫持系统出站流量(基于 iptables无需客户端显式配置
- **Traffic Splitting分流**:支持多种分流规则,包括 GFWList、大陆白名单、全局代理等
- **Docker 部署**:官方提供 Docker 镜像 `mzz2017/v2raya`,支持 Host 网络模式
## Key Configuration
| 配置项 | 值 |
|--------|-----|
| Docker 镜像 | `mzz2017/v2raya` |
| 推荐网络模式 | `--network=host` |
| HTTP 代理端口 | 20171默认 |
| Web UI 端口 | 2017 |
| 推荐分流模式 | "大陆白名单Whitelist of Mainland China" |
| 环境变量 | `IPTABLES_MODE=legacy` |
## Related Sources
- [[群晖NAS科学上网方法]] — V2RayA 在群晖 NAS 上的完整安装与 Docker Daemon 代理配置
- [[Ubuntu-Server科学上网]] — V2RayA 在 Ubuntu Server 上的安装
## Related Concepts
- [[透明代理]] — V2RayA 的核心实现机制
- [[分流模式]] — V2RayA 的路由策略
- [[Docker-Daemon-Proxy]] — V2RayA 的替代方案,直接为 Docker 守护进程配置代理
- [[iptables]] — 透明代理依赖的内核防火墙规则
## Related Entities
- [[Synology-DSM]] — V2RayA 的典型部署平台之一
- [[Docker]] — V2RayA 的运行环境和被代理对象
- [[Xray]] — V2Ray 的上游核心V2RayA 基于此运行

View File

@@ -1,67 +1,48 @@
---
title: "cAdvisor"
type: entity
aliases: [cAdvisor, Container Advisor, Google cAdvisor]
tags: [monitoring, container, docker, prometheus, kubernetes]
date: 2025-11-11
---
# cAdvisor
## Overview
cAdvisorContainer Advisor是 Google 开源的容器资源监控工具,专门为 Docker 容器提供资源使用和性能指标的采集。它能自动发现机器上运行的所有容器,收集包括 CPU、内存、网络、磁盘 I/O 在内的各项资源指标,并暴露 Prometheus 格式的 `/metrics` 端点。
## Key Characteristics
- **自动发现**:自动发现并监控机器上所有 Docker 容器,无需手动配置
- **容器层级指标**:单容器粒度的资源使用数据
- **历史数据**:支持容器级别的资源历史趋势
- **Docker Socket 依赖**:需要挂载 `/var/run/docker.sock` 访问容器运行时信息
## Key Metrics Collected
| 分类 | 指标前缀 | 说明 |
|------|----------|------|
| CPU | `container_cpu_usage_seconds_total` | 容器 CPU 使用时间 |
| 内存 | `container_memory_usage_bytes` | 容器内存使用量 |
| 网络 | `container_network_receive_bytes_total` | 网络接收字节 |
| 磁盘 | `container_fs_reads_bytes_total` | 磁盘读取字节 |
| 进程 | `container_tasks` | 容器内任务/进程数 |
| 重启 | `container_restart_count` | 容器重启次数 |
| 资源限制 | `container_spec_memory_limit_bytes` | 内存限制值 |
## Home Server Deployment
```yaml
# docker-compose.yml 片段
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
restart: always
ports:
- "8080:8080" # 暴露 metrics 端点
volumes:
- /:/rootfs:ro # 根文件系统
- /var/run:/var/run:ro # Docker socket 目录
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro # Docker 存储
```
> ⚠️ **安全注意**:挂载 Docker socket`/var/run/docker.sock`)授予容器等同于宿主机 root 的权限。审慎评估风险,仅在内网可信环境中使用。
## Prometheus scrape_config
```yaml
- job_name: 'cadvisor'
static_configs:
- targets: ['cadvisor:8080']
```
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Entities
- [[Prometheus]] — 数据消费者
- [[Docker]] — 容器运行时依赖
- [[node_exporter]] — 互补的主机层指标
## Related Concepts
- [[Exporter]] — Prometheus 生态组件
- [[容器资源限制]] — 容器 OOM / CPU 限制配置
- [[System Monitoring]] — 应用领域
---
title: "cAdvisor"
type: entity
tags: [monitoring, container, docker, prometheus, devops]
last_updated: 2026-04-26
---
## cAdvisor — Google 容器指标采集器
**官方网址:** https://github.com/google/cadvisor
**类型:** 开源项目 / 容器监控工具
**别名:**
- cadvisor
- Google cAdvisor
- Container Advisor
---
## Overview
cAdvisor 是 Google 开发的容器监控工具自动采集单个节点上运行的所有容器的资源使用情况CPU、内存、网络、磁盘 I/O并以 Prometheus 可抓取的格式暴露指标。
**采集指标示例:**
- `container_cpu_usage_seconds_total` — 容器 CPU 使用
- `container_memory_usage_bytes` 容器内存使用
- `container_network_receive_bytes_total` 容器网络接收
- `container_last_seen` — 容器最后活跃时间
- `container_restart_total` — 容器重启次数
**典型部署:**
- Docker: `gcr.io/cadvisor/cadvisor:latest`
- 端口:`8080`
- 需要挂载:`/var/run`Docker socket`/sys``/var/lib/docker/`
**关键告警规则示例:**
- 容器异常退出: `increase(container_last_seen[5m]) == 0`(容器未上报即可能已退出)
**安全注意:** 需审慎挂载 Docker socket权限等同于宿主机 root
---
## Used By
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]