summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--krebs/5pkgs/collectd-connect-time/default.nix15
-rw-r--r--makefu/1systems/wry.nix3
-rw-r--r--makefu/2configs/collectd/collectd-base.nix42
-rw-r--r--makefu/2configs/unstable-sources.nix2
4 files changed, 61 insertions, 1 deletions
diff --git a/krebs/5pkgs/collectd-connect-time/default.nix b/krebs/5pkgs/collectd-connect-time/default.nix
new file mode 100644
index 000000000..bff4928cc
--- /dev/null
+++ b/krebs/5pkgs/collectd-connect-time/default.nix
@@ -0,0 +1,15 @@
+{lib, pkgs, pythonPackages, fetchurl, ... }:
+
+pythonPackages.buildPythonPackage rec {
+ name = "collectd-connect-time-${version}";
+ version = "0.1.1";
+ src = fetchurl {
+ url = "https://pypi.python.org/packages/source/c/collectd-connect-time/collectd-connect-time-${version}.tar.gz";
+ sha256 = "0j2glcm4qjry1hqgci84ifj83xjpannl5yckyjadc8s9vyf0mp99";
+ };
+ meta = {
+ homepage = https://pypi.python.org/pypi/collectd-connect-time/;
+ description = "TCP Connection time plugin for collectd";
+ license = lib.licenses.wtfpl;
+ };
+}
diff --git a/makefu/1systems/wry.nix b/makefu/1systems/wry.nix
index 3baf31dc5..ca91fed94 100644
--- a/makefu/1systems/wry.nix
+++ b/makefu/1systems/wry.nix
@@ -19,6 +19,9 @@ in {
# Reaktor
../2configs/Reaktor/simpleExtend.nix
+
+ # collectd
+ ../2configs/collectd/collectd-base.nix
];
krebs.build = {
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) ];
+ };
+
+}
diff --git a/makefu/2configs/unstable-sources.nix b/makefu/2configs/unstable-sources.nix
index f2d28dcaf..5cb4e8016 100644
--- a/makefu/2configs/unstable-sources.nix
+++ b/makefu/2configs/unstable-sources.nix
@@ -4,7 +4,7 @@
krebs.build.source = {
git.nixpkgs = {
url = https://github.com/makefu/nixpkgs;
- rev = "984d33884d63d404ff2da76920b8bc8b15471552";
+ rev = "15b5bbfbd1c8a55e7d9e05dd9058dc102fac04fe"; # cherry-picked collectd
};
dir.secrets = {