Auto-sync: 2026-04-17 08:37

This commit is contained in:
2026-04-17 08:38:12 +08:00
parent 6caa1c2f47
commit a0a48bd334
247 changed files with 6577 additions and 3061 deletions

View File

@@ -0,0 +1,48 @@
---
title: "Blackbox_exporter"
type: concept
tags: [exporter, prometheus, blackbox, monitoring]
sources: [家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]
last_updated: 2026-04-16
---
## Definition
Blackbox_exporter 是 Prometheus 官方提供的黑盒探测 exporter通过 HTTP、HTTPS、TCP、ICMP、DNS 等协议探测目标可用性和性能。
## Supported Modules
- **HTTP/HTTPS**探测状态码、响应时间、TLS 证书
- **TCP**:端口连通性
- **ICMP**主机可达性ping
- **DNS**:域名解析
## Use Cases
- 网站可用性监控
- TLS 证书到期告警
- DNS 解析监控
- 内网服务健康检查
## Key Metrics
- `probe_success`探测是否成功0/1
- `probe_duration_seconds`:探测耗时
- `probe_http_status_code`HTTP 状态码
- `probe_ssl_earliest_cert_expiry`SSL 证书到期时间
## Common Alert Rules
- HTTP 探测失败(连续 3 次)
- TLS 证书剩余 < 14 天
- 响应时间 > 阈值
## Docker 部署
```yaml
blackbox:
image: prom/blackbox-exporter:latest
ports:
- "9115:9115"
```
## Default Port
- 9115
## Connections
- [[Blackbox_exporter]] ← scrapes_by ← [[Prometheus]]
- [[Blackbox_exporter]] ← blackbox_monitoring ← [[Uptime Kuma]](可选集成)