nrdp_tokens = mkOption { type = listOf str; description = "Tokens allowed to push status update"; };
slack_url = mkOption { type = str; description = "Slack webhook url to push status update"; };
slack_channel = mkOption { type = str; description = "Slack channel to push status update"; };
+ netdata_aggregator = mkOption { type = str; description = "Url where netdata information should be sent"; };
+ netdata_keys = mkOption { type = attrsOf str; description = "netdata host keys"; };
contacts = mkOption { type = attrsOf unspecified; description = "Contact dicts to fill naemon objects"; };
email_check = mkOption {
description = "Emails services to check";
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
+ upstreams."netdata".servers = { "127.0.0.1:19999" = {}; };
+ upstreams."netdata".extraConfig = ''
+ keepalive 64;
+ '';
virtualHosts."status.immae.eu" = {
acmeRoot = config.myServices.certificates.webroot;
useACMEHost = name;
forceSSL = true;
locations."/".proxyPass = "http://unix:/run/naemon-status/socket.sock:/";
+
+ locations."= /netdata".return = "301 /netdata/";
+ locations."~ /netdata/(?<ndpath>.*)".extraConfig = ''
+ proxy_redirect off;
+ proxy_set_header Host $host;
+
+ proxy_set_header X-Forwarded-Host $host;
+ proxy_set_header X-Forwarded-Server $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_http_version 1.1;
+ proxy_pass_request_headers on;
+ proxy_set_header Connection "keep-alive";
+ proxy_store off;
+ proxy_pass http://netdata/$ndpath$is_args$args;
+
+ gzip on;
+ gzip_proxied any;
+ gzip_types *;
+ '';
};
};
security.acme.certs."${name}" = {
services.duplyBackup.enable = false;
services.duplyBackup.profiles.oldies.rootDir = "/var/lib/oldies";
+ services.netdata.enable = true;
+ services.netdata.config.global."memory mode" = "none";
+ services.netdata.config.health."enabled" = "no";
+ services.netdata.config.web.mode = "none";
+ environment.etc."netdata/stream.conf".text = ''
+ [stream]
+ enabled = yes
+ destination = ${config.myEnv.monitoring.netdata_aggregator}
+ api key = ${config.myEnv.monitoring.netdata_keys.eldiron}
+ '';
secrets.keys = [
{
dest = "zrepl_backup/identity";
})
];
+ services.netdata.enable = true;
+ services.netdata.config.web."allow dashboard from" = "localhost";
+ services.netdata.config.web."allow badges from" = "*";
+ services.netdata.config.web."allow streaming from" = "*";
+ services.netdata.config.web."allow netdata.conf from" = "fd*";
+ services.netdata.config.web."allow management from" = "fd*";
+ networking.firewall.allowedTCPPorts = [ 19999 ];
+ environment.etc."netdata/stream.conf".text = builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList (_: key: ''
+ [${key}]
+ enabled = yes
+ default history = 3600
+ default memory = ram
+ health enabled by default = auto
+ '') config.myEnv.monitoring.netdata_keys);
# This value determines the NixOS release with which your system is
# to be compatible, in order to avoid breaking some software such as
# database servers. You should change this only after NixOS release
-Subproject commit 4ce3c27d2e3db66640a5478aae93b813b7005061
+Subproject commit c91ba443bf2849b8fb81fc72818b77be77b3aabf