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 ./grocy.nix
./taskwarrior-pushover.nix ./taskwarrior-pushover.nix
#./neo4j.nix #./neo4j.nix
./jellyfin.nix #./jellyfin.nix
./wireguard.nix ./wireguard.nix
#./tts.nix #./tts.nix
./telegraf.nix
# logging # logging
./loki.nix ./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,23 +8,28 @@
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
}; };
services.nginx = { services.nginx =
enable = true; let
virtualHosts. "flix.ingolf-wagner.de" = { flixConfig = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
extraConfig = '' extraConfig = ''
# Security / XSS Mitigation Headers # Security / XSS Mitigation Headers
# NOTE: X-Frame-Options may cause issues with the webOS app # NOTE: X-Frame-Options may cause issues with the webOS app
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block"; add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff"; add_header X-Content-Type-Options "nosniff";
''; '';
locations."/" = { locations."/" = {
recommendedProxySettings = true; recommendedProxySettings = true;
proxyWebsockets = true; proxyWebsockets = true;
proxyPass = "http://localhost:8096"; 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 = { lost-fotos = {
enable = true; enable = true;
path = "/media/syncthing/lost-fotos.ct"; path = "/media/syncthing/lost-fotos.ct";
rescanInterval = 40 * 24 * 3600;
}; };
movies = { movies = {
enable = true; enable = true;
watch = true; watch = true;
path = "/media/syncthing/movies"; path = "/media/syncthing/movies";
rescanInterval = 16 * 3600;
}; };
music-library = { music-library = {
enable = true; enable = true;
watch = true; watch = true;
path = "/media/syncthing/music"; path = "/media/syncthing/music";
rescanInterval = 2 * 24 * 3600;
}; };
music-projects = { music-projects = {
enable = true; enable = true;
@ -59,16 +62,19 @@
enable = true; enable = true;
watch = true; watch = true;
path = "/media/syncthing/nextcloud_backup"; path = "/media/syncthing/nextcloud_backup";
rescanInterval = 23 * 3600;
}; };
samples = { samples = {
enable = true; enable = true;
watch = true; watch = true;
path = "/media/syncthing/samples"; path = "/media/syncthing/samples";
rescanInterval = 41 * 24 * 3600;
}; };
series = { series = {
enable = true; enable = true;
watch = true; watch = true;
path = "/media/syncthing/series"; path = "/media/syncthing/series";
rescanInterval = 15 * 3600;
}; };
}; };

View file

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