feat: define global monitoring for each service and automatically configure telegraf based on it

This commit is contained in:
oddlama 2024-07-14 14:11:53 +02:00
parent 79e1e782c4
commit e35daee76d
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
23 changed files with 403 additions and 83 deletions

View file

@ -1,7 +1,20 @@
{config, ...}: {
{
config,
lib,
...
}: let
icfg = config.repo.secrets.local.networking.interfaces.wan;
in {
networking.hostId = config.repo.secrets.local.networking.hostId;
networking.domain = config.repo.secrets.global.domains.me;
globals.monitoring.ping.sentinel = {
hostv4 = lib.net.cidr.ip icfg.hostCidrv4;
hostv6 = lib.net.cidr.ip icfg.hostCidrv6;
location = "external";
network = "internet";
};
# Forwarding required for forgejo 9922->22
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
@ -11,9 +24,7 @@
};
systemd.network.networks = {
"10-wan" = let
icfg = config.repo.secrets.local.networking.interfaces.wan;
in {
"10-wan" = {
address = [
icfg.hostCidrv4
icfg.hostCidrv6