add telegraf and fix iowait problems

This commit is contained in:
Ingolf Wagner 2023-02-24 02:01:18 +01:00
parent 8ea47e6d55
commit ee2f34867b
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
6 changed files with 74 additions and 20 deletions

View file

@ -20,9 +20,10 @@
./grocy.nix
./taskwarrior-pushover.nix
#./neo4j.nix
./jellyfin.nix
#./jellyfin.nix
./wireguard.nix
#./tts.nix
./telegraf.nix
# logging
./loki.nix

View file

@ -66,6 +66,18 @@
};
}];
}
{
# see https://www.home-assistant.io/integrations/prometheus/
job_name = "telgraf";
metrics_path = "/metrics";
static_configs = [{
targets = [ "localhost:9273" ];
labels = {
service = "telegraf";
server = "pepe";
};
}];
}
];
};
}

View file

@ -0,0 +1,30 @@
let
urls = [
"https://bitwarden.ingolf-wagner.de"
"https://flix.ingolf-wagner.de"
"https://git.ingolf-wagner.de"
"https://ingolf-wagner.de"
"https://nextcloud.ingolf-wagner.de"
"https://nextcloud.ingolf-wagner.de"
"https://tech.ingolf-wagner.de"
];
in
{
services.telegraf = {
enable = true;
extraConfig = {
outputs.prometheus_client = {
listen = ":9273";
metric_version = 2;
};
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins
inputs = {
x509_cert = [{
sources = (map (url: "${url}:443") urls);
interval = "30m"; # agent.interval = "10s" is default
}];
http_response = [{ inherit urls; }];
};
};
};
}

View file

@ -8,9 +8,9 @@
driSupport = true;
driSupport32Bit = true;
};
services.nginx = {
enable = true;
virtualHosts. "flix.ingolf-wagner.de" = {
services.nginx =
let
flixConfig = {
forceSSL = true;
enableACME = true;
extraConfig = ''
@ -26,5 +26,10 @@
proxyPass = "http://localhost:8096";
};
};
in
{
enable = true;
virtualHosts. "flix.ingolf-wagner.de" = flixConfig;
virtualHosts. "video.ingolf-wagner.de" = flixConfig;
};
}

View file

@ -39,16 +39,19 @@
lost-fotos = {
enable = true;
path = "/media/syncthing/lost-fotos.ct";
rescanInterval = 40 * 24 * 3600;
};
movies = {
enable = true;
watch = true;
path = "/media/syncthing/movies";
rescanInterval = 16 * 3600;
};
music-library = {
enable = true;
watch = true;
path = "/media/syncthing/music";
rescanInterval = 2 * 24 * 3600;
};
music-projects = {
enable = true;
@ -59,16 +62,19 @@
enable = true;
watch = true;
path = "/media/syncthing/nextcloud_backup";
rescanInterval = 23 * 3600;
};
samples = {
enable = true;
watch = true;
path = "/media/syncthing/samples";
rescanInterval = 41 * 24 * 3600;
};
series = {
enable = true;
watch = true;
path = "/media/syncthing/series";
rescanInterval = 15 * 3600;
};
};

View file

@ -79,7 +79,7 @@
lvs = {
root = {
type = "lvm_lv";
size = "100G";
size = "200G";
content = {
type = "filesystem";
format = "ext4";
@ -91,7 +91,7 @@
};
home = {
type = "lvm_lv";
size = "150G";
size = "250G";
content = {
type = "filesystem";
format = "ext4";