2015-10-27 17:11:13 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
# graphite-web on port 8080
|
|
|
|
# carbon cache on port 2003 (tcp/udp)
|
2016-10-20 18:54:38 +00:00
|
|
|
with import <stockholm/lib>;
|
2015-10-27 17:11:13 +00:00
|
|
|
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>
|
2018-01-09 18:13:02 +00:00
|
|
|
target "wry.r" "localhost" "google.com"
|
2015-10-27 17:11:13 +00:00
|
|
|
interval 30
|
|
|
|
</Module>
|
|
|
|
</Plugin>
|
|
|
|
'';
|
|
|
|
graphite-cfg = pkgs.writeText "collectd-graphite-cfg" ''
|
|
|
|
LoadPlugin write_graphite
|
|
|
|
<Plugin "write_graphite">
|
|
|
|
<Carbon>
|
2018-01-09 18:13:02 +00:00
|
|
|
Host "heidi.r"
|
2015-10-27 17:11:13 +00:00
|
|
|
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) ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|