summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/stats/telegraf/default.nix
blob: 941685695ede468c8c7fed45e44f718d39a247a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{...}:
let
  url = "http://localhost:8086";
  mqtt_server = "localhost:1883";
in {
  services.telegraf = {
    enable = true;
    extraConfig = {
      agent.debug = false;
      outputs = {
        influxdb = [{
          urls = [ url ];
          database = "telegraf";
        }];
        #file = [{ # debugging
        #  files = [ "stdout" ];
        #  data_format = "influx";
        #}];

        mqtt = [{
          servers = [ mqtt_server ];
          topic_prefix = "/telegraf";
          data_format = "json";
          qos = 0;
          batch = false;
        }];
      };
    };
  };
}