From 9cd4430bef7b150a7de41e2cc5b602a6018623b5 Mon Sep 17 00:00:00 2001 From: Nicolas Berens Date: Sun, 25 Aug 2024 16:02:53 +0200 Subject: [PATCH] persist a few experiments --- roles/ff_monitor/tasks/main.yml | 2 +- roles/ff_monitor/templates/grafana.ini.j2 | 6 ++++++ roles/ff_monitor/templates/prometheus.j2 | 2 +- roles/ff_monitor/templates/prometheus.yml.j2 | 15 +++++++++++++++ templates/Caddyfile_monitor.j2 | 12 ++++++++++-- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/roles/ff_monitor/tasks/main.yml b/roles/ff_monitor/tasks/main.yml index f51692a..b0c286a 100644 --- a/roles/ff_monitor/tasks/main.yml +++ b/roles/ff_monitor/tasks/main.yml @@ -75,7 +75,7 @@ name: remove old rrd files special_time: daily user: root - job: find /mnt/collectd/rrd/ -type f -mtime +14 -delete; find /mnt/collectd/rrd/ -type d -empty -delete + job: find /mnt/collectd/rrd/ -type f -mtime +30 -delete; find /mnt/collectd/rrd/ -type d -empty -delete - name: Create a directory if it does not exist ansible.builtin.file: diff --git a/roles/ff_monitor/templates/grafana.ini.j2 b/roles/ff_monitor/templates/grafana.ini.j2 index 5ca5636..78ece40 100644 --- a/roles/ff_monitor/templates/grafana.ini.j2 +++ b/roles/ff_monitor/templates/grafana.ini.j2 @@ -16,6 +16,7 @@ router_logging = false [analytics] reporting_enabled = false check_for_updates = false +enabled = false [security] disable_gravatar = true [users] @@ -97,8 +98,13 @@ enabled = true [plugins] allow_loading_unsigned_plugins = panodata-map-panel +hide_angular_deprecation = true [feature_toggles] +angularDeprecationUI=false publicDashboards = true [unified_alerting] enabled = true + +[panels] +enable_alpha = true \ No newline at end of file diff --git a/roles/ff_monitor/templates/prometheus.j2 b/roles/ff_monitor/templates/prometheus.j2 index c6768bc..b69636a 100644 --- a/roles/ff_monitor/templates/prometheus.j2 +++ b/roles/ff_monitor/templates/prometheus.j2 @@ -1,4 +1,4 @@ # {{ ansible_managed }} # Set the command-line arguments to pass to the server. -ARGS="--storage.tsdb.retention.size=90GB --enable-feature=memory-snapshot-on-shutdown --web.listen-address=127.0.0.1:9090" +ARGS="--storage.tsdb.retention.size=100GB --enable-feature=memory-snapshot-on-shutdown --web.listen-address=127.0.0.1:9090" diff --git a/roles/ff_monitor/templates/prometheus.yml.j2 b/roles/ff_monitor/templates/prometheus.yml.j2 index 3be110d..afddefa 100644 --- a/roles/ff_monitor/templates/prometheus.yml.j2 +++ b/roles/ff_monitor/templates/prometheus.yml.j2 @@ -8,6 +8,7 @@ alerting: - targets: ['localhost:9093'] rule_files: + - rules.yml scrape_configs: @@ -25,6 +26,13 @@ scrape_configs: static_configs: - targets: ['localhost:9090'] + - job_name: 'pushgateway' + scrape_interval: 30s + scrape_timeout: 30s + honor_labels: true + static_configs: + - targets: ['localhost:9091'] + - job_name: collectd scrape_interval: 30s static_configs: @@ -38,6 +46,13 @@ scrape_configs: - job_name: servers static_configs: - targets: + - "a36s-hyp03.berlin.freifunk.net:9100" {% for host in groups.all %} - "{{ host }}:9100" {% endfor %} + + - job_name: 'weather' + scrape_interval: 900s + scrape_timeout: 30s + static_configs: + - targets: ['127.0.0.1:9111'] diff --git a/templates/Caddyfile_monitor.j2 b/templates/Caddyfile_monitor.j2 index a4aba0e..b6887ad 100644 --- a/templates/Caddyfile_monitor.j2 +++ b/templates/Caddyfile_monitor.j2 @@ -14,5 +14,13 @@ monitor.berlin.freifunk.net { } - - +# Pushgw +http://10.31.130.151:9091 { + bind 10.31.130.151 +# @delete-get { # TODO Fix +# return 418 +# } +# @put-post { + reverse_proxy http://127.0.0.1:9091 +# } +}