From 5bbed3d52d242df55b6c96ee0b46b5303e673cdc Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Mon, 3 Aug 2015 14:27:23 +0000 Subject: dd-agent: if nginx and mongodb integrations are enabled, then disk and network settings are not gathered anymore. This fixes the problem --- nixos/modules/services/monitoring/dd-agent.nix | 28 ++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/monitoring/dd-agent.nix b/nixos/modules/services/monitoring/dd-agent.nix index 0e0340e2fa3f..8c847af3bfc0 100644 --- a/nixos/modules/services/monitoring/dd-agent.nix +++ b/nixos/modules/services/monitoring/dd-agent.nix @@ -51,6 +51,24 @@ let # ganglia_port: 8651 ''; + diskConfig = pkgs.writeText "disk.yaml" '' + init_config: + + instances: + - use_mount: no + ''; + + networkConfig = pkgs.writeText "network.yaml" '' + init_config: + + instances: + # Network check only supports one configured instance + - collect_connection_state: false + excluded_interfaces: + - lo + - lo0 + ''; + postgresqlConfig = pkgs.writeText "postgres.yaml" cfg.postgresqlConfig; nginxConfig = pkgs.writeText "nginx.yaml" cfg.nginxConfig; mongoConfig = pkgs.writeText "mongo.yaml" cfg.mongoConfig; @@ -58,6 +76,12 @@ let etcfiles = [ { source = ddConf; target = "dd-agent/datadog.conf"; + } + { source = diskConfig; + target = "dd-agent/conf.d/disk.yaml"; + } + { source = networkConfig; + target = "dd-agent/conf.d/network.yaml"; } ] ++ (optional (cfg.postgresqlConfig != null) { source = postgresqlConfig; @@ -143,7 +167,7 @@ in { Restart = "always"; RestartSec = 2; }; - restartTriggers = [ pkgs.dd-agent ddConf postgresqlConfig nginxConfig mongoConfig ]; + restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig ]; }; systemd.services.dogstatsd = { @@ -160,7 +184,7 @@ in { RestartSec = 2; }; environment.SSL_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt"; - restartTriggers = [ pkgs.dd-agent ddConf postgresqlConfig nginxConfig mongoConfig ]; + restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig ]; }; environment.etc = etcfiles; -- cgit 1.4.1