diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/1systems/wolf.nix | 3 | ||||
-rw-r--r-- | shared/2configs/collectd-base.nix | 41 |
2 files changed, 43 insertions, 1 deletions
diff --git a/shared/1systems/wolf.nix b/shared/1systems/wolf.nix index aeaeee288..60d1e8ce8 100644 --- a/shared/1systems/wolf.nix +++ b/shared/1systems/wolf.nix @@ -5,6 +5,7 @@ with lib; { imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> + ../2configs/collectd-base.nix ]; krebs.build.host = config.krebs.hosts.wolf; @@ -26,7 +27,7 @@ with lib; krebs.build.source = { git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; - rev = "e916273209560b302ab231606babf5ce1c481f08"; + rev = "6d31e9b81dcd4ab927bb3dc91b612dd5abfa2f80"; }; dir.secrets = { host = config.krebs.current.host; diff --git a/shared/2configs/collectd-base.nix b/shared/2configs/collectd-base.nix new file mode 100644 index 000000000..3b792bf23 --- /dev/null +++ b/shared/2configs/collectd-base.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, ... }: + +# TODO: krebs.collectd.plugins +with lib; +let + connect-time-cfg = with pkgs; writeText "collectd-connect-time.conf" '' + LoadPlugin python + <Plugin python> + ModulePath "${collectd-connect-time}/lib/${python.libPrefix}/site-packages/" + Import "collectd_connect_time" + <Module collectd_connect_time> + target "localhost:22" "google.com" "google.de" "gum.retiolum:22" "gum.krebsco.de" "heidi.shack:22" "10.42.0.1:22" "heise.de" "t-online.de" + interval 10 + </Module> + </Plugin> + ''; + graphite-cfg = pkgs.writeText "collectd-graphite.conf" '' + LoadPlugin write_graphite + <Plugin "write_graphite"> + <Carbon> + Host "heidi.shack" + Port "2003" + Prefix "retiolum." + EscapeCharacter "_" + StoreRates false + AlwaysAppendDS false + </Carbon> + </Plugin> + ''; +in { + imports = [ ]; + + nixpkgs.config.packageOverrides = pkgs: with pkgs; { + collectd = pkgs.collectd.override { python= pkgs.python; }; + }; + services.collectd = { + enable = true; + include = [ (toString connect-time-cfg) (toString graphite-cfg) ]; + }; + +} |