diff options
| author | Jakub Stachurski <jakub@wilkuu.xyz> | 2026-06-29 19:17:08 +0200 |
|---|---|---|
| committer | Jakub Stachurski <jakub@wilkuu.xyz> | 2026-06-29 19:17:08 +0200 |
| commit | c4ac6a0b88ff83a90a3c957034b52bedbe4d5868 (patch) | |
| tree | 5122bdf38be616ad5359dad31a684f46ed0f1525 /hosts/tacitus | |
| parent | e7e8d7656c1eaef422a02aa4a4d84545a31d3ce5 (diff) | |
uuuuh
Diffstat (limited to 'hosts/tacitus')
| -rw-r--r-- | hosts/tacitus/default.nix | 57 | ||||
| -rw-r--r-- | hosts/tacitus/network.nix | 2 |
2 files changed, 58 insertions, 1 deletions
diff --git a/hosts/tacitus/default.nix b/hosts/tacitus/default.nix index f4a135c..50d5542 100644 --- a/hosts/tacitus/default.nix +++ b/hosts/tacitus/default.nix @@ -64,4 +64,61 @@ PermitRootLogin = "no"; }; }; + users.groups.mikrotik-exporter = { }; + users.users.mikrotik-exporter = { + isSystemUser = true; + group = "mikrotik-exporter"; + }; + + # TODO: "Make each device hold it's own password." + sops.secrets."prometheus/mikrotik/username" = { + owner = "mikrotik-exporter"; + sopsFile = ../../secrets/tacitus/prometheus.yaml; + }; + sops.secrets."prometheus/mikrotik/password" = { + owner = "mikrotik-exporter"; + sopsFile = ../../secrets/tacitus/prometheus.yaml; + }; + + sops.templates."prometheus-mikrotik-config" = { + owner = "mikrotik-exporter"; + content = lib.generators.toYAML {} { + devices = [ + { + name = "chronosphere"; + address = "192.168.88.1"; + user = config.sops.placeholder."prometheus/mikrotik/username"; + password = config.sops.placeholder."prometheus/mikrotik/password"; + } + { + name = "geneticmutator"; + address = "192.168.88.2"; + user = config.sops.placeholder."prometheus/mikrotik/username"; + password = config.sops.placeholder."prometheus/mikrotik/password"; + } + + ]; + features = { + dhcp = true; + dhcpv6 = true; + optics = true; + health = true; + poe = true; + wlansta = true; + wlanif = true; + monitor=true; + routes = true; + firware = true; + netwatch = true; + conntrack = true; + }; + }; + }; + + services.prometheus.exporters.mikrotik = { + enable = true; + group = "mikrotik-exporter"; + user = "mikrotik-exporter"; + configFile = config.sops.templates.prometheus-mikrotik-config.path; + }; } diff --git a/hosts/tacitus/network.nix b/hosts/tacitus/network.nix index d29e73f..df48a9b 100644 --- a/hosts/tacitus/network.nix +++ b/hosts/tacitus/network.nix @@ -6,7 +6,7 @@ let 25 80 443 - config.services.grafana.port + config.services.grafana.settings.server.http_port config.services.prometheus.port ] ++ lib.mapAttrsToList (_: opt: opt.port) ( |
