--- 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]]