2017-09-19 14:37:46 +00:00
|
|
|
{...}:
|
|
|
|
let
|
|
|
|
url = "http://localhost:8086";
|
2019-09-25 12:51:43 +00:00
|
|
|
mqtt_server = "localhost:1883";
|
2017-09-19 14:37:46 +00:00
|
|
|
in {
|
|
|
|
services.telegraf = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = {
|
2019-09-25 12:51:43 +00:00
|
|
|
agent.debug = false;
|
2017-09-19 14:37:46 +00:00
|
|
|
outputs = {
|
|
|
|
influxdb = [{
|
|
|
|
urls = [ url ];
|
|
|
|
database = "telegraf";
|
|
|
|
}];
|
2020-06-14 09:51:07 +00:00
|
|
|
#file = [{ # debugging
|
|
|
|
# files = [ "stdout" ];
|
|
|
|
# data_format = "influx";
|
|
|
|
#}];
|
|
|
|
|
|
|
|
#mqtt = [{
|
|
|
|
# servers = [ mqtt_server ];
|
|
|
|
# topic_prefix = "/telegraf";
|
|
|
|
# data_format = "json";
|
|
|
|
# qos = 0;
|
|
|
|
# batch = false;
|
|
|
|
#}];
|
2017-09-19 14:37:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|