1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 14:50:40 +02:00

feat: let the influxdb machine do uptime tracking to cut down on runtime multi node dependencies to get metrics in

This commit is contained in:
oddlama 2024-05-27 01:28:24 +02:00
parent cbd22db8c0
commit 6483bd4f7e
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
4 changed files with 69 additions and 69 deletions

View file

@ -56,9 +56,6 @@
popups = 20;
};
nix.settings.trusted-substituters = ["https://ai.cachix.org"];
nix.settings.trusted-public-keys = ["ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="];
#meta.promtail = {
# enable = true;
# proxy = "sentinel";

View file

@ -77,6 +77,7 @@ in {
};
};
globals.services.grafana.domain = grafanaDomain;
nodes.sentinel = {
age.secrets.loki-basic-auth-hashes.generator.dependencies = [
config.age.secrets.grafana-loki-basic-auth-password

View file

@ -20,6 +20,74 @@ in {
firewallRuleForNode.ward-web-proxy.allowedTCPPorts = [influxdbPort];
};
age.secrets.github-access-token = {
rekeyFile = config.node.secretsDir + "/github-access-token.age";
mode = "440";
group = "telegraf";
};
meta.telegraf.secrets."@GITHUB_ACCESS_TOKEN@" = config.age.secrets.github-access-token.path;
services.telegraf.extraConfig.outputs.influxdb_v2.urls = lib.mkForce ["http://localhost:${toString influxdbPort}"];
services.telegraf.extraConfig.inputs = {
ping = [
{
method = "native";
urls = [
"192.168.178.1"
"192.168.1.1"
];
tags.type = "internal";
fieldpass = [
"percent_packet_loss"
"average_response_ms"
"standard_deviation_ms"
"reply_received"
"percent_reply_loss"
];
}
{
method = "native";
urls = [
"1.1.1.1"
"8.8.8.8"
config.repo.secrets.global.domains.me
config.repo.secrets.global.domains.personal
];
tags.type = "external";
fieldpass = [
"percent_packet_loss"
"average_response_ms"
"standard_deviation_ms"
"reply_received"
"percent_reply_loss"
];
}
];
# FIXME: pls define this on the relevant hosts. Then we can ping it from multiple other hosts
#http_response = [
# {
# urls = [
# ];
# response_string_match = "Index of /";
# response_status_code = 200;
# }
#];
github = {
access_token = "@GITHUB_ACCESS_TOKEN@";
repositories = [
"oddlama/agenix-rekey"
"oddlama/autokernel"
"oddlama/gentoo-install"
"oddlama/nix-config"
"oddlama/nix-topology"
"oddlama/vane"
];
};
};
globals.services.influxdb.domain = influxdbDomain;
nodes.sentinel = {
networking.providedDomains.influxdb = influxdbDomain;

View file

@ -33,72 +33,6 @@ in {
inherit (acme) certs wildcardDomains;
};
age.secrets.github-access-token = {
rekeyFile = config.node.secretsDir + "/github-access-token.age";
mode = "440";
group = "telegraf";
};
meta.telegraf.secrets."@GITHUB_ACCESS_TOKEN@" = config.age.secrets.github-access-token.path;
services.telegraf.extraConfig.inputs = {
ping = [
{
method = "native";
urls = [
"192.168.178.1"
"192.168.1.1"
];
tags.type = "internal";
fieldpass = [
"percent_packet_loss"
"average_response_ms"
"standard_deviation_ms"
"reply_received"
"percent_reply_loss"
];
}
{
method = "native";
urls = [
"1.1.1.1"
"8.8.8.8"
config.repo.secrets.global.domains.me
config.repo.secrets.global.domains.personal
];
tags.type = "external";
fieldpass = [
"percent_packet_loss"
"average_response_ms"
"standard_deviation_ms"
"reply_received"
"percent_reply_loss"
];
}
];
# FIXME: pls define this on the relevant hosts. Then we can ping it from multiple other hosts
#http_response = [
# {
# urls = [
# ];
# response_string_match = "Index of /";
# response_status_code = 200;
# }
#];
github = {
access_token = "@GITHUB_ACCESS_TOKEN@";
repositories = [
"oddlama/agenix-rekey"
"oddlama/autokernel"
"oddlama/gentoo-install"
"oddlama/nix-config"
"oddlama/nix-topology"
"oddlama/vane"
];
};
};
services.nginx = {
upstreams.fritzbox = {
servers."192.168.178.1" = {};