summaryrefslogtreecommitdiff
path: root/hosts/tacitus/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/tacitus/default.nix')
-rw-r--r--hosts/tacitus/default.nix57
1 files changed, 57 insertions, 0 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;
+ };
}