summaryrefslogtreecommitdiffstats
path: root/lass/3modules/telegraf.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-02-09 16:45:29 +0100
committermakefu <github@syntax-fehler.de>2017-02-09 16:45:29 +0100
commit8cefb4663624bcc4fbf0379b2cc02f2e84f0320b (patch)
tree6bc760e37c02ea2c54c9702c0251e502b18ada75 /lass/3modules/telegraf.nix
parent4f34c772c2dd4e48a303d3ea3349ec11cd747498 (diff)
parente78a8c0725cbcf3179d63f8f94ca77e7ccb345d8 (diff)
Merge remote-tracking branch 'tv/master'
Diffstat (limited to 'lass/3modules/telegraf.nix')
-rw-r--r--lass/3modules/telegraf.nix84
1 files changed, 0 insertions, 84 deletions
diff --git a/lass/3modules/telegraf.nix b/lass/3modules/telegraf.nix
deleted file mode 100644
index 0b3be2d6..00000000
--- a/lass/3modules/telegraf.nix
+++ /dev/null
@@ -1,84 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with builtins;
-with lib;
-
-let
- cfg = config.lass.telegraf;
-
- out = {
- options.lass.telegraf = api;
- config = mkIf cfg.enable imp;
- };
-
- api = {
- enable = mkEnableOption "telegraf";
- dataDir = mkOption {
- type = types.str;
- default = "/var/lib/telegraf";
- };
- user = mkOption {
- type = types.str;
- default = "telegraf";
- };
- outputs = mkOption {
- type = types.str;
- default = ''
- [outputs.influxdb]
- urls = ["http://localhost:8086"]
- database = "telegraf_db"
- user_agent = "telegraf"
- '';
- };
- inputs = mkOption {
- type = with types; listOf str;
- default = [
- ''
- [cpu]
- percpu = false
- totalcpu = true
- drop = ["cpu_time"]
- ''
- ];
- };
- interval = mkOption {
- type = types.str;
- default = "10s";
- };
- config = mkOption {
- type = types.str;
- #TODO: find a good default
- default = ''
- [agent]
- interval = "${cfg.interval}"
-
- [outputs]
-
- ${cfg.outputs}
-
- ${concatStringsSep "\n" cfg.inputs}
-
- '';
- description = "configuration telegraf is started with";
- };
- };
-
- configFile = pkgs.writeText "telegraf.conf" cfg.config;
-
- imp = {
-
- systemd.services.telegraf = {
- description = "telegraf";
- after = [ "network.target" ];
- wantedBy = [ "multi-user.target" ];
-
- restartIfChanged = true;
-
- serviceConfig = {
- Restart = "always";
- ExecStart = "${pkgs.telegraf}/bin/telegraf -config ${configFile}";
- };
- };
- };
-
-in out