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;
|
work.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,52 +3,52 @@
|
||||||
{
|
{
|
||||||
imports = [ ./hardware.nix ];
|
imports = [ ./hardware.nix ];
|
||||||
|
|
||||||
config = {
|
networking.hostId = "3cc1a4b2";
|
||||||
networking.hostId = "3cc1a4b2";
|
|
||||||
|
|
||||||
time.timeZone = "Europe/Brussels";
|
time.timeZone = "Europe/Brussels";
|
||||||
|
|
||||||
# Machine-specific module settings
|
# Machine-specific module settings
|
||||||
chvp = {
|
chvp = {
|
||||||
stateVersion = "20.09";
|
stateVersion = "20.09";
|
||||||
base = {
|
base = {
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
network.mobile = {
|
network.mobile = {
|
||||||
enable = true;
|
|
||||||
wireless-interface = "wlp0s20f3";
|
|
||||||
wired-interfaces = {
|
|
||||||
"enp0s31f6" = { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
zfs = {
|
|
||||||
encrypted = true;
|
|
||||||
backups = [
|
|
||||||
{
|
|
||||||
path = "rpool/safe/data";
|
|
||||||
remotePath = "zdata/recv/kholinar/safe/data";
|
|
||||||
fast = true;
|
|
||||||
location = "lasting-integrity";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
rootDataset = "rpool/local/root";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
development = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
android.enable = true;
|
wireless-interface = "wlp0s20f3";
|
||||||
|
wired-interfaces = {
|
||||||
|
"enp0s31f6" = { };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
games.enable = true;
|
zfs = {
|
||||||
graphical.enable = true;
|
encrypted = true;
|
||||||
programs = {
|
backups = [
|
||||||
calibre.enable = false;
|
{
|
||||||
deluge.enable = true;
|
path = "rpool/safe/data";
|
||||||
eid.enable = true;
|
remotePath = "zdata/recv/kholinar/safe/data";
|
||||||
element.enable = true;
|
fast = true;
|
||||||
hledger.enable = true;
|
location = "lasting-integrity";
|
||||||
obs.enable = true;
|
}
|
||||||
|
];
|
||||||
|
rootDataset = "rpool/local/root";
|
||||||
};
|
};
|
||||||
# It's a pandemic.
|
|
||||||
work.enable = true;
|
|
||||||
};
|
};
|
||||||
|
development = {
|
||||||
|
enable = true;
|
||||||
|
android.enable = true;
|
||||||
|
};
|
||||||
|
games.enable = true;
|
||||||
|
graphical.enable = true;
|
||||||
|
programs = {
|
||||||
|
calibre.enable = false;
|
||||||
|
deluge.enable = true;
|
||||||
|
eid.enable = true;
|
||||||
|
element.enable = true;
|
||||||
|
hledger.enable = true;
|
||||||
|
obs.enable = true;
|
||||||
|
};
|
||||||
|
# It's a pandemic.
|
||||||
|
work.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.telegraf.extraConfig.inputs.disk.mount_points = [ "/" "/boot" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,4 +112,5 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.msmtp.enable = false;
|
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
|
./smartd
|
||||||
./ssh
|
./ssh
|
||||||
./sshd
|
./sshd
|
||||||
|
./telegraf
|
||||||
./tmux
|
./tmux
|
||||||
./zfs
|
./zfs
|
||||||
./zsh
|
./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/smtp.age".publicKeys = [ lasting-integrity ] ++ users;
|
||||||
"secrets/passwords/services/grafana/admin-password.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/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;
|
"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