Skip to content

Commit 1105226

Browse files
committed
Fixes geerlingguy#25: Make it easy to configure which websites are pinged for HTTP checks.
1 parent 4545820 commit 1105226

File tree

6 files changed

+11
-16
lines changed

6 files changed

+11
-16
lines changed

example.config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ pihole_password: "change-this-password"
99
monitoring_enable: true
1010
monitoring_grafana_admin_password: "admin"
1111
monitoring_speedtest_interval: 60m
12+
monitoring_ping_hosts: # [URL];[HUMAN_READABLE_NAME]
13+
- https://www.google.com/;google.com
14+
- https://github.com/;github.com
15+
- https://www.apple.com/;apple.com
1216

1317
# Shelly Plug configuration. (Also requires `monitoring_enable`)
1418
shelly_plug_enable: false

internet-monitoring/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Internet Monitoring Docker Stack with Prometheus + Grafana
22

33
> This repository is a fork from [maxandersen/internet-monitoring](https://github.com/maxandersen/internet-monitoring), tailored for use on a Raspberry Pi. It has only been tested on a Raspberry Pi 4 running Pi OS 64-bit beta.
4+
>
5+
> This has also recently been merged into the internet-pi repository, so there could be a few little things that need tweaking.
46
57
Stand-up a Docker [Prometheus](http://prometheus.io/) stack containing Prometheus, Grafana with [blackbox-exporter](https://github.com/prometheus/blackbox_exporter), and [speedtest-exporter](https://github.com/MiguelNdeCarvalho/speedtest-exporter) to collect and graph home Internet reliability and throughput.
68

internet-monitoring/prometheus/pinghosts.yaml

-8
This file was deleted.

tasks/internet-monitoring.yml

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
dest: grafana/config.monitoring
3737
- src: prometheus.yml.j2
3838
dest: prometheus/prometheus.yml
39+
- src: prometheus-pinghosts.yaml.j2
40+
dest: prometheus/pinghosts.yaml
3941
notify: Restart internet-monitoring
4042
become: false
4143

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- targets:
3+
{{ monitoring_ping_hosts | to_nice_yaml() | indent(4, True) }}

templates/prometheus.yml.j2

-8
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ scrape_configs:
5050
regex: '(.*);(.*);(.*);(.*)' # second is humanname to use in charts
5151
target_label: humanname
5252
replacement: $2
53-
- source_labels: [__address__]
54-
regex: '(.*);(.*);(.*);(.*)' # third state whether this is testing external or internal network
55-
target_label: routing
56-
replacement: $3
57-
- source_labels: [__address__]
58-
regex: '(.*);(.*);(.*);(.*)' # fourth is which switch/router the device is connected to.
59-
target_label: switching
60-
replacement: $4
6153
- source_labels: [instance]
6254
target_label: __param_target
6355
- target_label: __address__

0 commit comments

Comments
 (0)