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;