summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/collectd-base.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-07-14 00:41:36 +0200
committerlassulus <lassulus@lassul.us>2017-07-14 00:41:36 +0200
commit8d128c769aec24d8989db8220d680ea6f4735193 (patch)
tree8c8a6132fda88ba989bbb7fc170b54b1ca242987 /krebs/2configs/collectd-base.nix
parentc4627764062a42f8d952ff90557c1e0d8735485f (diff)
parent58380c82848c3db0bd6c3d74904153f3464c2098 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/2configs/collectd-base.nix')
-rw-r--r--krebs/2configs/collectd-base.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/krebs/2configs/collectd-base.nix b/krebs/2configs/collectd-base.nix
new file mode 100644
index 000000000..440f83fce
--- /dev/null
+++ b/krebs/2configs/collectd-base.nix
@@ -0,0 +1,41 @@
+{ config, lib, pkgs, ... }:
+
+# TODO: krebs.collectd.plugins
+with import <stockholm/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.r: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) ];
+ };
+
+}