diff --git a/hosts/ildkule/services/monitoring/prometheus/default.nix b/hosts/ildkule/services/monitoring/prometheus/default.nix index 6f3f95e..cd4e4a9 100644 --- a/hosts/ildkule/services/monitoring/prometheus/default.nix +++ b/hosts/ildkule/services/monitoring/prometheus/default.nix @@ -4,9 +4,8 @@ ./matrix-synapse.nix # TODO: enable once https://github.com/NixOS/nixpkgs/pull/242365 gets merged # ./mysqld.nix - ./node.nix ./postgres.nix - ./systemd.nix + ./machines.nix ]; services.prometheus = { diff --git a/hosts/ildkule/services/monitoring/prometheus/machines.nix b/hosts/ildkule/services/monitoring/prometheus/machines.nix new file mode 100644 index 0000000..21028e2 --- /dev/null +++ b/hosts/ildkule/services/monitoring/prometheus/machines.nix @@ -0,0 +1,54 @@ +{ config, ... }: let + cfg = config.services.prometheus; +in { + services.prometheus.scrapeConfigs = [{ + job_name = "base_info"; + static_configs = [ + { labels.hostname = "ildkule"; + targets = [ + "ildkule.pvv.ntnu.no:${toString cfg.exporters.node.port}" + "ildkule.pvv.ntnu.no:${toString cfg.exporters.systemd.port}" + ]; + } + { labels.hostname = "bekkalokk"; + targets = [ + "bekkalokk.pvv.ntnu.no:9100" + "bekkalokk.pvv.ntnu.no:9101" + ]; + } + { labels.hostname = "bicep"; + targets = [ + "bicep.pvv.ntnu.no:9100" + "bicep.pvv.ntnu.no:9101" + ]; + } + { labels.hostname = "brzeczyszczykiewicz"; + targets = [ + "brzeczyszczykiewicz.pvv.ntnu.no:9100" + "brzeczyszczykiewicz.pvv.ntnu.no:9101" + ]; + } + { labels.hostname = "georg"; + targets = [ + "georg.pvv.ntnu.no:9100" + "georg.pvv.ntnu.no:9101" + ]; + } + { labels.hostname = "hildring"; + targets = [ + "hildring.pvv.ntnu.no:9100" + ]; + } + { labels.hostname = "isvegg"; + targets = [ + "isvegg.pvv.ntnu.no:9100" + ]; + } + { labels.hostname = "microbel"; + targets = [ + "microbel.pvv.ntnu.no:9100" + ]; + } + ]; + }]; +} diff --git a/hosts/ildkule/services/monitoring/prometheus/node.nix b/hosts/ildkule/services/monitoring/prometheus/node.nix deleted file mode 100644 index be62f7b..0000000 --- a/hosts/ildkule/services/monitoring/prometheus/node.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, ... }: let - cfg = config.services.prometheus; -in { - services.prometheus.scrapeConfigs = [{ - job_name = "node"; - static_configs = [ - { - targets = [ - "ildkule.pvv.ntnu.no:${toString cfg.exporters.node.port}" - "microbel.pvv.ntnu.no:9100" - "isvegg.pvv.ntnu.no:9100" - "knakelibrak.pvv.ntnu.no:9100" - "hildring.pvv.ntnu.no:9100" - "bicep.pvv.ntnu.no:9100" - "essendrop.pvv.ntnu.no:9100" - "andresbu.pvv.ntnu.no:9100" - "bekkalokk.pvv.ntnu.no:9100" - ]; - } - ]; - }]; -} diff --git a/hosts/ildkule/services/monitoring/prometheus/systemd.nix b/hosts/ildkule/services/monitoring/prometheus/systemd.nix deleted file mode 100644 index 6361c43..0000000 --- a/hosts/ildkule/services/monitoring/prometheus/systemd.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, ... }: let - cfg = config.services.prometheus; -in { - services.prometheus.scrapeConfigs = [{ - job_name = "systemd"; - static_configs = [ - { - targets = [ - "ildkule.pvv.ntnu.no:${toString cfg.exporters.node.port}" - "bicep.pvv.ntnu.no:9101" - "bekkalokk.pvv.ntnu.no:9101" - "brzeczyszczykiewicz.pvv.ntnu.no:9101" - "georg.pvv.ntnu.no:9101" - ]; - } - ]; - }]; -}