diff options
author | makefu <github@syntax-fehler.de> | 2015-10-27 18:11:13 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-10-27 18:11:13 +0100 |
commit | 3708839857669e3c7fc9899e324350ff55a34586 (patch) | |
tree | 47dc77c1f70f3d0e339ab5309623fe45b98670e5 /makefu/2configs | |
parent | 8c9c74a03bfc1aa7b74bd1d4098851075608f311 (diff) |
m 2 collectd: add first sample howto configure collectd with collectd-connect-time
Diffstat (limited to 'makefu/2configs')
-rw-r--r-- | makefu/2configs/collectd/collectd-base.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/makefu/2configs/collectd/collectd-base.nix b/makefu/2configs/collectd/collectd-base.nix new file mode 100644 index 000000000..7909c1be5 --- /dev/null +++ b/makefu/2configs/collectd/collectd-base.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +# graphite-web on port 8080 +# carbon cache on port 2003 (tcp/udp) +with lib; +let + connect-time-cfg = with pkgs; writeText "collectd-connect-time.cfg" '' + LoadPlugin python + <Plugin python> + ModulePath "${collectd-connect-time}/lib/${python.libPrefix}/site-packages/" + Import "collectd_connect_time" + <Module collectd_connect_time> + target "wry.retiolum" "localhost" "google.com" + interval 30 + </Module> + </Plugin> + ''; + graphite-cfg = pkgs.writeText "collectd-graphite-cfg" '' + 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) ]; + }; + +} |