Merge branch 'master' of pnp:stockholm

This commit is contained in:
makefu 2015-10-28 22:07:51 +01:00
commit 7fe4f6dc17
4 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,15 @@
{lib, pkgs, pythonPackages, fetchurl, ... }:
pythonPackages.buildPythonPackage rec {
name = "collectd-connect-time-${version}";
version = "0.2.1";
src = fetchurl {
url = "https://pypi.python.org/packages/source/c/collectd-connect-time/collectd-connect-time-${version}.tar.gz";
sha256 = "0611h53ww9lk1qm27njsffckkibirmq7p8cxlq02dgl1zbh7583d";
};
meta = {
homepage = https://pypi.python.org/pypi/collectd-connect-time/;
description = "TCP Connection time plugin for collectd";
license = lib.licenses.wtfpl;
};
}

View File

@ -23,6 +23,8 @@ in {
# other nginx
../2configs/nginx/euer.wiki.nix
# collectd
../2configs/collectd/collectd-base.nix
];
krebs.build = {

View File

@ -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) ];
};
}

View File

@ -5,7 +5,7 @@
krebs.build.source = {
git.nixpkgs = {
url = https://github.com/makefu/nixpkgs;
rev = "984d33884d63d404ff2da76920b8bc8b15471552";
rev = "15b5bbfbd1c8a55e7d9e05dd9058dc102fac04fe"; # cherry-picked collectd
};
dir.secrets = {