Prometheus之blackbox exporter实现ICMP监控
一 ICMP监控配置
1.1 修改Prometheus Server配置文件
root@prometheus-01:~# cat /usr/local/prometheus/prometheus.yml
#ICMP 检测
- job_name: 'ping_status'
metrics_path: /probe
params:
module: [icmp]
static_configs:
- targets:
- 192.168.174.200
- 192.168.174.103
labels:
instance: ping_status
group: icmp
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: ip
- target_label: __address__
replacement: 192.168.174.104:9115 # The blackbox exporter's real hostname:port.
1.2 检查文件
root@prometheus-01:~# /usr/local/prometheus/promtool check config /usr/local/prometheus/prometheus.yml
Checking /usr/local/prometheus/prometheus.yml
SUCCESS: 1 rule files found
Checking /usr/local/prometheus/alert_rules/instance_up.yaml
SUCCESS: 1 rules found
1.3 重启Prometheus服务
root@prometheus-01:~# systemctl restart prometheus
二 Prometheus验证数据
三 blackbox exporter验证数据