From 8c9c74a03bfc1aa7b74bd1d4098851075608f311 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 27 Oct 2015 18:10:32 +0100 Subject: k 5 collectd-connect-time: initial commit --- krebs/5pkgs/collectd-connect-time/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 krebs/5pkgs/collectd-connect-time/default.nix 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; + }; +} -- cgit v1.2.3 From 3708839857669e3c7fc9899e324350ff55a34586 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 27 Oct 2015 18:11:13 +0100 Subject: m 2 collectd: add first sample howto configure collectd with collectd-connect-time --- makefu/2configs/collectd/collectd-base.nix | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 makefu/2configs/collectd/collectd-base.nix 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 + + ModulePath "${collectd-connect-time}/lib/${python.libPrefix}/site-packages/" + Import "collectd_connect_time" + + target "wry.retiolum" "localhost" "google.com" + interval 30 + + + ''; + graphite-cfg = pkgs.writeText "collectd-graphite-cfg" '' + LoadPlugin write_graphite + + + Host "heidi.retiolum" + Port "2003" + Prefix "retiolum." + EscapeCharacter "_" + StoreRates false + AlwaysAppendDS false + + + ''; +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) ]; + }; + +} -- cgit v1.2.3 From fe4f5b98b91f6bacb036d57b5322fb4e09c22f14 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 27 Oct 2015 18:12:05 +0100 Subject: m 12 collectd: wry uses cherry-picked collectd to enable python support --- makefu/1systems/wry.nix | 3 +++ makefu/2configs/unstable-sources.nix | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/makefu/1systems/wry.nix b/makefu/1systems/wry.nix index 6627d87b5..fc98179e4 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/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 = { -- cgit v1.2.3 From d394cd26de014c718431b970c7d8e47a725a8202 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 27 Oct 2015 18:59:46 +0100 Subject: k 5 collectd-connect-time: bump to 0.2.0 --- krebs/5pkgs/collectd-connect-time/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/collectd-connect-time/default.nix b/krebs/5pkgs/collectd-connect-time/default.nix index bff4928cc..c94bf21a6 100644 --- a/krebs/5pkgs/collectd-connect-time/default.nix +++ b/krebs/5pkgs/collectd-connect-time/default.nix @@ -2,10 +2,10 @@ pythonPackages.buildPythonPackage rec { name = "collectd-connect-time-${version}"; - version = "0.1.1"; + version = "0.2.0"; src = fetchurl { url = "https://pypi.python.org/packages/source/c/collectd-connect-time/collectd-connect-time-${version}.tar.gz"; - sha256 = "0j2glcm4qjry1hqgci84ifj83xjpannl5yckyjadc8s9vyf0mp99"; + sha256 = "1l63pi79z6vg4xf744a71g5rxgsngpkc96a7y4ha2x798r55g7v6"; }; meta = { homepage = https://pypi.python.org/pypi/collectd-connect-time/; -- cgit v1.2.3 From bbd28caa40c06574653fc8364157721c562eabbb Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 28 Oct 2015 00:42:36 +0100 Subject: krebs 5 collectd-connect-time: bump version (again) --- krebs/5pkgs/collectd-connect-time/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/collectd-connect-time/default.nix b/krebs/5pkgs/collectd-connect-time/default.nix index c94bf21a6..b07a119db 100644 --- a/krebs/5pkgs/collectd-connect-time/default.nix +++ b/krebs/5pkgs/collectd-connect-time/default.nix @@ -2,10 +2,10 @@ pythonPackages.buildPythonPackage rec { name = "collectd-connect-time-${version}"; - version = "0.2.0"; + version = "0.2.1"; src = fetchurl { url = "https://pypi.python.org/packages/source/c/collectd-connect-time/collectd-connect-time-${version}.tar.gz"; - sha256 = "1l63pi79z6vg4xf744a71g5rxgsngpkc96a7y4ha2x798r55g7v6"; + sha256 = "0611h53ww9lk1qm27njsffckkibirmq7p8cxlq02dgl1zbh7583d"; }; meta = { homepage = https://pypi.python.org/pypi/collectd-connect-time/; -- cgit v1.2.3