diff --git a/nixos/hosts/olympus/dhcp/configuration.nix b/nixos/hosts/olympus/dhcp/configuration.nix index 13b002b..daf061a 100644 --- a/nixos/hosts/olympus/dhcp/configuration.nix +++ b/nixos/hosts/olympus/dhcp/configuration.nix @@ -33,6 +33,12 @@ in { networking.firewall.allowedUDPPorts = [ 67 ]; + services.prometheus.exporters.kea = { + enable = true; + openFirewall = true; + controlSocketPaths = [ "/run/kea/kea-dhcp4.socket" ]; + }; + services.kea.dhcp4 = { enable = true; settings = { @@ -43,6 +49,11 @@ in { interfaces-config.interfaces = [ "eth0" ]; + control-socket = { + socket-type = "unix"; + socket-name = "/run/kea/kea-dhcp4.socket"; + }; + lease-database = { name = "/var/lib/kea/dhcp4.leases"; persist = true; diff --git a/nixos/hosts/olympus/victoriametrics/configuration.nix b/nixos/hosts/olympus/victoriametrics/configuration.nix index 20374b4..8879bac 100644 --- a/nixos/hosts/olympus/victoriametrics/configuration.nix +++ b/nixos/hosts/olympus/victoriametrics/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, ... }: let vmPort = 8428; grafanaDomain = config.meta.exposes.grafana.domain; @@ -18,10 +18,6 @@ in { # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "21.11"; # Did you read the comment? - - # Additional packages - environment.systemPackages = with pkgs; [ ]; - networking.firewall.allowedTCPPorts = [ vmPort grafanaPort ]; networking.firewall.allowedUDPPorts = [ vmPort ]; @@ -41,6 +37,13 @@ in { scrape_timeout = "30s"; }; scrape_configs = [ + { + job_name = "kea"; + static_configs = [{ + targets = [ "dhcp.olympus:9547" ]; + labels.app = "dhcp"; + }]; + } { job_name = "nginx"; static_configs = [{