Setup basic telegraf reporting

This commit is contained in:
Charlotte Van Petegem 2022-04-30 22:20:05 +02:00
parent 928c60fefc
commit 10c7e3dcea
No known key found for this signature in database
GPG key ID: 019E764B7184435A
8 changed files with 93 additions and 41 deletions

View file

@ -46,4 +46,6 @@
};
work.enable = true;
};
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot" ];
}

View file

@ -3,7 +3,6 @@
{
imports = [ ./hardware.nix ];
config = {
networking.hostId = "3cc1a4b2";
time.timeZone = "Europe/Brussels";
@ -50,5 +49,6 @@
# It's a pandemic.
work.enable = true;
};
};
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot" ];
}

View file

@ -112,4 +112,5 @@
};
};
programs.msmtp.enable = false;
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot/ESP0" "/boot/ESP1" "/srv/data" ];
}

View file

@ -55,4 +55,6 @@
};
};
};
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot/ESP0" "/boot/ESP1" "/srv/data" ];
}

View file

@ -10,6 +10,7 @@
./smartd
./ssh
./sshd
./telegraf
./tmux
./zfs
./zsh

View file

@ -0,0 +1,45 @@
{ config, lib, pkgs, ... }:
{
services.telegraf = {
enable = true;
extraConfig = {
agent = {
interval = "10s";
round_interval = true;
metric_batch_size = 1000;
metric_buffer_limit = 10000;
collection_jitter = "0s";
flush_interval = "10s";
flush_jitter = "0s";
precision = "0s";
omit_hostname = false;
};
outputs.influxdb_v2 = {
urls = [ "https://stats.chvp.be:8086" ];
token = "$TOKEN";
organization = "default";
bucket = "default";
};
inputs = {
cpu = {
percpu = true;
totalcpu = true;
collect_cpu_time = false;
report_active = false;
};
diskio = { };
kernel = { };
mem = { };
processes = { };
swap = { };
system = { };
};
};
environmentFiles = [ config.age.secrets."passwords/services/telegraf-env".path ];
};
age.secrets."passwords/services/telegraf-env" = {
file = ../../../secrets/passwords/services/telegraf-env.age;
owner = "telegraf";
};
}

View file

@ -57,6 +57,7 @@ in
"secrets/passwords/services/grafana/smtp.age".publicKeys = [ lasting-integrity ] ++ users;
"secrets/passwords/services/grafana/admin-password.age".publicKeys = [ lasting-integrity ] ++ users;
"secrets/passwords/services/grafana/secret-key.age".publicKeys = [ lasting-integrity ] ++ users;
"secrets/passwords/services/telegraf-env.age".publicKeys = hosts ++ users;
"secrets/passwords/services/nextcloud-admin.age".publicKeys = [ lasting-integrity ] ++ users;

Binary file not shown.