Setup basic telegraf reporting
This commit is contained in:
parent
928c60fefc
commit
10c7e3dcea
8 changed files with 93 additions and 41 deletions
|
@ -46,4 +46,6 @@
|
|||
};
|
||||
work.enable = true;
|
||||
};
|
||||
|
||||
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot" ];
|
||||
}
|
||||
|
|
|
@ -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" ];
|
||||
}
|
||||
|
|
|
@ -112,4 +112,5 @@
|
|||
};
|
||||
};
|
||||
programs.msmtp.enable = false;
|
||||
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot/ESP0" "/boot/ESP1" "/srv/data" ];
|
||||
}
|
||||
|
|
|
@ -55,4 +55,6 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot/ESP0" "/boot/ESP1" "/srv/data" ];
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
./smartd
|
||||
./ssh
|
||||
./sshd
|
||||
./telegraf
|
||||
./tmux
|
||||
./zfs
|
||||
./zsh
|
||||
|
|
45
modules/base/telegraf/default.nix
Normal file
45
modules/base/telegraf/default.nix
Normal 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";
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
|
BIN
secrets/passwords/services/telegraf-env.age
Normal file
BIN
secrets/passwords/services/telegraf-env.age
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue