nixos-config/machines/chungus/telemetry/telegraf.nix
Ingolf Wagner 7a6510a4e6
Some checks are pending
Build all NixOS Configurations / nix build (push) Waiting to run
nix fmt
2024-08-29 08:26:04 +07:00

57 lines
1.2 KiB
Nix

{ config, pkgs, ... }:
let
urls = [
{
url = "https://bitwarden.ingolf-wagner.de";
path = "";
}
{
url = "https://flix.ingolf-wagner.de";
path = "web/index.html";
}
{
url = "https://git.ingolf-wagner.de";
path = "";
}
{
url = "https://ingolf-wagner.de";
path = "";
}
{
url = "https://nextcloud.ingolf-wagner.de";
path = "login";
}
{
url = "https://tech.ingolf-wagner.de";
path = "";
}
{
url = "https://matrix.ingolf-wagner.de";
path = "";
}
];
in
{
services.telegraf = {
extraConfig = {
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins
inputs = {
x509_cert = [
{
sources = (map (url: "${url.url}:443") urls);
interval = "30m"; # agent.interval = "10s" is default
}
];
http_response =
let
fullUrls = map ({ url, path }: "${url}/${path}") urls;
in
[ { urls = fullUrls; } ];
internet_speed.interval = "10m";
nginx.urls = [ "http://localhost/nginx_status" ];
};
};
};
}