From 7c5324dac85f5bbceb47c227f2ee2c77c5c61043 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Thu, 26 Sep 2024 17:49:19 +0200 Subject: [PATCH] nuc: add elbe pegel --- hosts/nuc/modules/monitoring/default.nix | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hosts/nuc/modules/monitoring/default.nix b/hosts/nuc/modules/monitoring/default.nix index 84bd804..8c7c03c 100644 --- a/hosts/nuc/modules/monitoring/default.nix +++ b/hosts/nuc/modules/monitoring/default.nix @@ -93,6 +93,19 @@ in enable = true; enabledCollectors = [ "systemd" ]; }; + json = { + enable = true; + configFile = pkgs.writeText "json-exporter.yml" '' + --- + modules: + pegelstand: + metrics: + - name: pegelstand_elbe_dresden + path: '{ $.pegel }' + type: value + help: Pegelstand in Dresden + ''; + }; }; scrapeConfigs = [ { @@ -127,6 +140,20 @@ in targets = [ "nuc.vpn.rfive.de:9300" ]; }]; } + { + job_name = "pegel_dresden"; + metrics_path = "/probe"; + params = { + module = [ "pegelstand" ]; + target = [ + "https://api.stramke.com/wasserstand/sachsen/Dresden" + ]; + }; + static_configs = [{ + targets = [ "nuc.vpn.rfive.de:7979" ]; + }]; + scrape_interval = "5m"; + } { job_name = "caddy"; static_configs = [{