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" = {
|
2020-09-13 11:56:58 +00:00
|
|
|
# Disable constant GET request logging.
|
|
|
|
# $loggable map is defined in 1/wolf
|
|
|
|
extraConfig = ''
|
|
|
|
access_log syslog:server=unix:/dev/log combined if=$loggable;
|
|
|
|
'';
|
2019-07-19 14:04:45 +00:00
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:${toString port}/";
|
|
|
|
};
|
|
|
|
};
|
2022-02-14 19:06:09 +00:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
(self: super:
|
|
|
|
{
|
|
|
|
# Hotfix for https://github.com/NixOS/nixpkgs/issues/157543
|
|
|
|
collectd = super.collectd.override { xen = null; };
|
|
|
|
}
|
|
|
|
)
|
|
|
|
];
|
2019-07-19 14:04:45 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|