m 2 collectd: add first sample howto configure collectd with collectd-connect-time
This commit is contained in:
parent
8c9c74a03b
commit
3708839857
42
makefu/2configs/collectd/collectd-base.nix
Normal file
42
makefu/2configs/collectd/collectd-base.nix
Normal 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) ];
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user