Ajout Telegraf-InfluxDB-Grafana

This commit is contained in:
nyanloutre 2018-04-01 15:04:49 +02:00
parent 279ca4ea9c
commit 803d1efa8f
3 changed files with 33 additions and 0 deletions

View File

@ -9,6 +9,7 @@
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./users.nix
./services.nix
];
# Use the systemd-boot EFI boot loader.

View File

@ -47,6 +47,11 @@
fsType = "zfs";
};
fileSystems."/mnt/influxdb" =
{ device = "loutrepool/etc/influxdb";
fsType = "zfs";
};
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 4;

27
services.nix Normal file
View File

@ -0,0 +1,27 @@
{ config, pkgs, ... }:
{
services.influxdb.enable = true;
services.influxdb.dataDir = "/mnt/influxdb";
services.telegraf.enable = true;
services.telegraf.extraConfig = {
inputs = {
zfs = { poolMetrics = true; };
net = { interfaces = [ "eno1" "eno2" "eno3" "eno4" ]; };
netstat = {};
cpu = { totalcpu = true; };
kernel = {};
mem = {};
processes = {};
system = {};
};
outputs = {
influxdb = { database = "telegraf"; urls = [ "http://localhost:8086" ]; };
};
};
services.grafana.enable = true;
services.grafana.addr = "0.0.0.0";
networking.firewall.allowedTCPPorts = [ 3000 ];
}