diff options
author | makefu <github@syntax-fehler.de> | 2015-10-30 15:28:12 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-10-30 15:28:12 +0100 |
commit | 46edbc82a39e5a569130d74977ad5ac6b0cd4541 (patch) | |
tree | 493806b88f69d27b763e89d8d62a745bc707677e /shared/2configs | |
parent | bd4b77d9411d151b021d8f7d66208c2fa3d74972 (diff) |
shared wolf: enable collectd towards heidi
Diffstat (limited to 'shared/2configs')
-rw-r--r-- | shared/2configs/collectd-base.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/shared/2configs/collectd-base.nix b/shared/2configs/collectd-base.nix new file mode 100644 index 0000000..b2ec40b --- /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 "heidi.retiolum:8080" "localhost" "google.com" "google.de" "omo.retiolum" "gum.retiolum" "gum.krebsco.de" + interval 10 + </Module> + </Plugin> + ''; + graphite-cfg = pkgs.writeText "collectd-graphite.conf" '' + LoadPlugin write_graphite + <Plugin "write_graphite"> + <Carbon> + Host "heidi.retiolum" + 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) ]; + }; + +} |