diff --git a/nix/nixos-module/collectd/dhcpcount.rb b/nix/nixos-module/collectd/dhcpcount.rb index d7ef59d..7bd6b24 100755 --- a/nix/nixos-module/collectd/dhcpcount.rb +++ b/nix/nixos-module/collectd/dhcpcount.rb @@ -10,13 +10,15 @@ STDOUT.sync = true loop do seen = {} count = 0 - - header = nil + now = Time.now.to_i CSV::readlines("/var/lib/kea/kea-leases4.csv", headers: true).each do |rec| h = rec.to_h addr = h["hwaddr"] next unless addr + last = h["expire"].to_i + elapsed = now - last + next if elapsed >= TIMEOUT unless seen[addr] count += 1 diff --git a/nix/nixos-module/container/dhcp-server.nix b/nix/nixos-module/container/dhcp-server.nix index cbb6fbc..3321ed0 100644 --- a/nix/nixos-module/container/dhcp-server.nix +++ b/nix/nixos-module/container/dhcp-server.nix @@ -50,6 +50,7 @@ in code = 6; data = "172.20.73.8, 9.9.9.9"; } ]; + ddns-qualifying-suffix = domainName; }); match-client-id = false;