Merge pull request #19 from M0r13n/use-blackbox-exporter

replace smokeping with blackbox
This commit is contained in:
Leon Morten Richter 2023-03-11 13:41:23 +01:00 committed by GitHub
commit 41149e4296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 629 additions and 483 deletions

View file

@ -149,13 +149,13 @@ Done. You should now be able to open the Grafana dashboard on Port 3000 of your
## Latency Monitoring ## Latency Monitoring
This projects uses a [smokeping prober](https://github.com/SuperQ/smokeping_prober) to measure network latency and packet loss. By default three targets are configured: This projects uses the Prometheus Blackbox exporter to measure network latency. By default three targets are configured:
- 1.1.1.1 (Cloudflare) - 1.1.1.1 (Cloudflare)
- 8.8.8.8 (Google) - 8.8.8.8 (Google)
- 9.9.9.9 (IBM) - 9.9.9.9 (IBM)
You may adjust **smokeping/smokeping.yml** according to your needs. You may adjust **blackbox/blackbox.yml** according to your needs.
## Multiple Nodes ## Multiple Nodes
@ -209,7 +209,7 @@ docker-compose -f docker-compose-armored.yml up -d
- [A somewhat useable Grafana Dashboard](https://grafana.com/grafana/dashboards/10950) - [A somewhat useable Grafana Dashboard](https://grafana.com/grafana/dashboards/10950)
- [A Prometheus exporter for Mikrotik devices written in Python](https://github.com/akpw/mktxp). - [A Prometheus exporter for Mikrotik devices written in Python](https://github.com/akpw/mktxp).
- [A Prometheus exporter for Mikrotik devices written in Go](https://github.com/nshttpd/mikrotik-exporter) - [A Prometheus exporter for Mikrotik devices written in Go](https://github.com/nshttpd/mikrotik-exporter)
- [Smokeping](https://github.com/SuperQ/smokeping_prober) - [Prometheus Blackbox exporter](https://github.com/prometheus/blackbox_exporter/blob/master/example.yml)
## FAQ ## FAQ

6
blackbox/blackbox.yml Normal file
View file

@ -0,0 +1,6 @@
modules:
icmp_ttl5:
prober: icmp
timeout: 5s
icmp:
ttl: 10

View file

@ -78,15 +78,14 @@ services:
- default - default
restart: unless-stopped restart: unless-stopped
# https://github.com/SuperQ/smokeping_prober blackbox:
smokeping: image: quay.io/prometheus/blackbox-exporter:latest
image: quay.io/superq/smokeping-prober:latest container_name: mikrotik-blackbox-exporter
container_name: mikrotik-smokeping-prober command: --config.file=/config/blackbox.yml
security_opt:
- apparmor:docker-mikrotik-monitoring
command: --config.file=/etc/smokeping/smokeping.yml
volumes: volumes:
- ./smokeping/smokeping.yml:/etc/smokeping/smokeping.yml - ./blackbox/blackbox.yml:/config/blackbox.yml
networks: networks:
- default - default
restart: unless-stopped restart: unless-stopped
security_opt:
- apparmor:docker-mikrotik-monitoring

View file

@ -16,6 +16,7 @@ services:
command: command:
- '--config.file=/etc/prometheus/prometheus.yml' - '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus' - '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=1y' # <= adjust the storage retention period of Prometheus
restart: unless-stopped restart: unless-stopped
networks: networks:
- default - default
@ -71,13 +72,13 @@ services:
- default - default
restart: unless-stopped restart: unless-stopped
# https://github.com/SuperQ/smokeping_prober # https://github.com/prometheus/blackbox_exporter/blob/master/example.yml
smokeping: blackbox:
image: quay.io/superq/smokeping-prober:latest image: quay.io/prometheus/blackbox-exporter:latest
container_name: mikrotik-smokeping-prober container_name: mikrotik-blackbox-exporter
command: --config.file=/etc/smokeping/smokeping.yml command: --config.file=/config/blackbox.yml
volumes: volumes:
- ./smokeping/smokeping.yml:/etc/smokeping/smokeping.yml - ./blackbox/blackbox.yml:/config/blackbox.yml
networks: networks:
- default - default
restart: unless-stopped restart: unless-stopped

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ rule_files:
# Here it's Prometheus itself. # Here it's Prometheus itself.
scrape_configs: scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus' - job_name: 'mikrotik'
# Override the global default and scrape targets from this job every 5 seconds. # Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 15s scrape_interval: 15s
@ -31,4 +31,21 @@ scrape_configs:
- targets: - targets:
- 'mikrotik_exporter:9436' - 'mikrotik_exporter:9436'
- 'mktxp:49090' - 'mktxp:49090'
- 'smokeping:9374'
- job_name: 'blackbox'
scrape_interval: 1s
metrics_path: /probe
params:
module: [icmp_ttl5] # use ICMP as the ping protocol
static_configs:
- targets:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115 # The blackbox exporter's real hostname:port.

View file

@ -1,10 +0,0 @@
---
targets:
- hosts:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
interval: 10s # Duration, Default 1s.
network: ip4 # One of ip, ip4, ip6. Default: ip (automatic IPv4/IPv6)
protocol: icmp # One of icmp, udp. Default: icmp (Requires privileged operation)
size: 56 # Packet data size in bytes. Default 56 (Range: 24 - 65535)