添加blackbox_exporter触发器告警规则 cat>> prometheus/rules/blackbox_exporter.yml <<"EOF"groups:-name: Blackbox rules:-alert: 黑盒子探测失败告警expr: probe_success ==0for: 1m labels: severity: critical annotations: summary:"黑盒子探测失败{{ $labels.instance }}"description:"黑盒子检测失败,当前...
# ingress-monitor.yamlapiVersion:monitoring.coreos.com/v1kind:Probemetadata:name:ingress-healthcheckspec:interval:30smodule:http_2xxprober:url:blackbox-exporter.monitoring.svc:9115targets:staticConfig:static:-https://api.example.com/healthz-https://console.example.com/loginlabels:team:gateway 场景2:...
在监控https网站时,probe_success一直返回0,看了很多文档,对照配置一直没有发现原因,最终在github issus中找到了答案,竟然是版本问题. 经过测试改用 prom/blackbox-exporter:v0.14.0 解决了问题
cat >/data/Software/prometheus-2.28.1.linux-amd64/targets/Blackbox-Exporter-tcp.yml <<-EOF - targets: - 10.0.28.7:2181 - 10.0.28.123:2181 - 10.0.25.33:2181 EOF 告警规则 1.业务正常性 icmp、tcp、http、post 监测是否正常可以观察probe_success 这一指标 probe_success == 0 ##联通性异常 probe...
probe_success: 表示探测是否成功(1:成功,0:失败)。 probe_duration_seconds: 表示探测完成的时长(单位:秒)。 6. 获取目标(target) target := params.Get("target") if target == "" { http.Error(w, "Target parameter is missing", http.StatusBadRequest) return } 获取URL 查询参数中的 target 参...
probe_success == 1 ##联通性正常 告警也是判断这个指标是否等于0,如等于0 则触发异常报警 image.png 2、通过 http 模块我们可以获取证书的过期时间,可以根据过期时间添加相关告警 probe_ssl_earliest_cert_expiry :可以查询证书到期时间。 image.png 经过单位转换我们可以得到一下,按天来计算:(probe_ssl_earliest...
2. Blackbox Exporter架构 Prometheus Blackbox Exporter的工作原理是对端点执行探测,并根据这些探测的结果返回指标。作为一个独立程序,以服务形式对我提供提供,可以通过curl命令调用Blackbox的接口实现服务探测,例如:curl http://10.2.103.54:9115/probe?target=10.2.103.129\&module=icmp,通过返回值判断探测目标正常与否...
官方github:https:///prometheus/blackbox_exporter 部署Blackbox_exporter [sss@prometheus01 ]$ cd /usr/local/blackbox_exporter/ [sss@prometheus01 ]$ wget https:///prometheus/blackbox_exporter/releases/download/v0.12.0/blackbox_exporter-0.12.0.linux-amd64.tar.gz ...
在blackbox_exporter中,可以通过定义HTTP的探测规则来设置针对HTTP服务的告警规则。以下是一个示例: - alert: HTTPServiceDown expr: probe_success == 0 for: 5m labels: severity: critical service: my_http_service 在上述示例中,我们定义了一个名为"HTTPServiceDown"的告警规则,通过`probe_success == 0`的...
replacement: 127.0.0.1:9098 # blackbox-exporter 服务所在的机器和端口 - job_name: 'blackbox_http_ping' # 检测是否可以ping通某些机器 scrape_interval: 30s metrics_path: /probe params: module: [icmp] static_configs: - targets: - 127.0.0.1 ...