Ajout Telegraf-InfluxDB-Grafana
This commit is contained in:
parent
279ca4ea9c
commit
803d1efa8f
@ -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.
|
||||
|
@ -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
27
services.nix
Normal 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 ];
|
||||
}
|
Loading…
Reference in New Issue
Block a user