add telegraf and fix iowait problems

feature/refacoring
Ingolf Wagner 2023-02-24 02:01:18 +01:00
parent 8ea47e6d55
commit ee2f34867b
Signed by: palo
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,23 +8,28 @@
driSupport = true;
driSupport32Bit = true;
};
services.nginx = {
enable = true;
virtualHosts. "flix.ingolf-wagner.de" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
# Security / XSS Mitigation Headers
# NOTE: X-Frame-Options may cause issues with the webOS app
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
'';
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://localhost:8096";
services.nginx =
let
flixConfig = {
forceSSL = true;
enableACME = true;
extraConfig = ''
# Security / XSS Mitigation Headers
# NOTE: X-Frame-Options may cause issues with the webOS app
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
'';
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
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";