2019-09-02 11:56:34 +00:00
|
|
|
{pkgs, ... }: # hostname: influx.shack
|
2019-07-19 14:04:45 +00:00
|
|
|
let
|
|
|
|
port = 8086;
|
2019-09-02 11:56:34 +00:00
|
|
|
collectd-port = 25826;
|
|
|
|
db = "collectd_db";
|
2019-07-19 14:04:45 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
networking.firewall.allowedTCPPorts = [ port ]; # for legacy applications
|
2019-09-02 11:56:34 +00:00
|
|
|
networking.firewall.allowedUDPPorts = [ collectd-port ];
|
2019-07-19 14:04:45 +00:00
|
|
|
services.nginx.virtualHosts."influx.shack" = {
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:${toString port}/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services.influxdb = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = {
|
2019-07-19 22:09:47 +00:00
|
|
|
http.bind-address = "0.0.0.0:${toString port}";
|
2019-07-19 14:04:45 +00:00
|
|
|
http.log-enabled = false;
|
2019-09-02 11:56:34 +00:00
|
|
|
http.write-tracing = false;
|
|
|
|
http.suppress-write-log = true;
|
|
|
|
data.trace-logging-enabled = false;
|
|
|
|
data.query-log-enabled = false;
|
|
|
|
monitoring.enabled = false;
|
|
|
|
collectd = [{
|
|
|
|
enabled = true;
|
|
|
|
typesdb = "${pkgs.collectd}/share/collectd/types.db";
|
|
|
|
database = db;
|
|
|
|
bind-address = ":${toString collectd-port}";
|
|
|
|
}];
|
2019-07-19 14:04:45 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|