summaryrefslogtreecommitdiffstats
path: root/lass/3modules/telegraf.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-02-09 14:54:56 +0100
committertv <tv@krebsco.de>2017-02-09 14:54:56 +0100
commit38d2ff961f2ad8d02ae6061952abe42e4de89f75 (patch)
treea8573db9389ba5268a8fb83ddef6d92e3e1a7815 /lass/3modules/telegraf.nix
parented406bd979609fd05f5846049f571f43e6512050 (diff)
parent954477b8674156754cd51021d92885b456a04a5b (diff)
Merge remote-tracking branch 'prism/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 0b3be2d69..000000000
--- 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