From 6b7f3d32ffbf69eb7c0832266489ae980b859b00 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 28 Jul 2021 23:10:45 +0200 Subject: [PATCH] =?UTF-8?q?netdata:=20monitor=20pve01,=20alert=20#r=C3=A9s?= =?UTF-8?q?eau=20over=20IRC,=20store=20more=20metrics=20(~2GiB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- machines/core-services-01/monitoring.nix | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/machines/core-services-01/monitoring.nix b/machines/core-services-01/monitoring.nix index 8316012..fe9ac46 100644 --- a/machines/core-services-01/monitoring.nix +++ b/machines/core-services-01/monitoring.nix @@ -6,6 +6,54 @@ in { services.netdata.enable = true; + systemd.services.netdata.restartTriggers = map (v: config.environment.etc."netdata/${v}.conf".source) [ + "netdata" + "stream" + "health_alarm_notify" + ]; + + environment.etc."netdata/netdata.conf" = { + user = "netdata"; + group = "netdata"; + mode = "0600"; + text = '' + [global] + page cache size = 32 + dbengine multihost disk space = 2048 + ''; + }; + + environment.etc."netdata/stream.conf" = { + user = "netdata"; + group = "netdata"; + mode = "0600"; + text = '' + [e245097d-bf52-4f66-9c10-984e8d5ee178] + enabled = yes + default history = 5000 + default memory mode = dbengine + health enabled by default = auto + allow from = 10.1.1.10 + ''; + }; + + environment.etc."netdata/health_alarm_notify.conf" = { + user = "netdata"; + group = "netdata"; + mode = "0600"; + text = '' + # External tools + nc="${pkgs.netcat}/bin/nc" + + # IRC configuration + SEND_IRC="YES" + DEFAULT_RECIPIENT_IRC="#réseau" + IRC_NETWORK="ens.wtf" + IRC_NICKNAME="core-services-01" + IRC_REALNAME="KlubRZ Core Services 01" + ''; + }; + services.oauth2_proxy = { enable = true; keyFile = config.age.secrets.oauth2ProxyKeyFile.path;