ma stats/telegraf: export to mqtt

This commit is contained in:
makefu 2019-09-25 14:51:43 +02:00
parent 4eed719039
commit acf23122ac
No known key found for this signature in database
GPG key ID: 36F7711F3FC0F225

View file

@ -1,16 +1,24 @@
{...}: {...}:
let let
url = "http://localhost:8086"; url = "http://localhost:8086";
mqtt_server = "localhost:1883";
in { in {
services.telegraf = { services.telegraf = {
enable = true; enable = true;
extraConfig = { extraConfig = {
agent.debug = true; agent.debug = false;
outputs = { outputs = {
influxdb = [{ influxdb = [{
urls = [ url ]; urls = [ url ];
database = "telegraf"; database = "telegraf";
}]; }];
mqtt = [{
servers = [ mqtt_server ];
topic_prefix = "/telegraf";
data_format = "json";
qos = 0;
batch = false;
}];
}; };
}; };
}; };