Merge pull request #297622 from mweinelt/kea-exporter-0.7.0
kea-exporter: 0.6.1 -> 0.7.0
This commit is contained in:
commit
3b7d9c77b3
@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, lib, options, ... }:
|
{ config, pkgs, lib, options, utils, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) concatStrings foldl foldl' genAttrs literalExpression maintainers
|
inherit (lib) concatStrings foldl foldl' genAttrs literalExpression maintainers
|
||||||
@ -94,10 +94,10 @@ let
|
|||||||
"zfs"
|
"zfs"
|
||||||
]
|
]
|
||||||
(name:
|
(name:
|
||||||
import (./. + "/exporters/${name}.nix") { inherit config lib pkgs options; }
|
import (./. + "/exporters/${name}.nix") { inherit config lib pkgs options utils; }
|
||||||
)) // (mapAttrs
|
)) // (mapAttrs
|
||||||
(name: params:
|
(name: params:
|
||||||
import (./. + "/exporters/${params.name}.nix") { inherit config lib pkgs options; type = params.type ; })
|
import (./. + "/exporters/${params.name}.nix") { inherit config lib pkgs options utils; type = params.type ; })
|
||||||
{
|
{
|
||||||
exportarr-bazarr = {
|
exportarr-bazarr = {
|
||||||
name = "exportarr";
|
name = "exportarr";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options, type }:
|
{ config, lib, pkgs, options, type, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.exporters."exportarr-${type}";
|
cfg = config.services.prometheus.exporters."exportarr-${type}";
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
, options
|
, options
|
||||||
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.exporters.graphite;
|
cfg = config.services.prometheus.exporters.graphite;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
, options
|
, utils
|
||||||
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
@ -9,18 +10,22 @@ with lib;
|
|||||||
let
|
let
|
||||||
cfg = config.services.prometheus.exporters.kea;
|
cfg = config.services.prometheus.exporters.kea;
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule [ "controlSocketPaths" ] [ "targets" ])
|
||||||
|
];
|
||||||
port = 9547;
|
port = 9547;
|
||||||
extraOpts = {
|
extraOpts = {
|
||||||
controlSocketPaths = mkOption {
|
targets = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
[
|
[
|
||||||
"/run/kea/kea-dhcp4.socket"
|
"/run/kea/kea-dhcp4.socket"
|
||||||
"/run/kea/kea-dhcp6.socket"
|
"/run/kea/kea-dhcp6.socket"
|
||||||
|
"http://127.0.0.1:8547"
|
||||||
]
|
]
|
||||||
'';
|
'';
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
Paths to kea control sockets
|
Paths or URLs to the Kea control socket.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -32,12 +37,11 @@ in {
|
|||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "kea";
|
User = "kea";
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
ExecStart = ''
|
ExecStart = utils.escapeSystemdExecArgs ([
|
||||||
${pkgs.prometheus-kea-exporter}/bin/kea-exporter \
|
(lib.getExe pkgs.prometheus-kea-exporter)
|
||||||
--address ${cfg.listenAddress} \
|
"--address" cfg.listenAddress
|
||||||
--port ${toString cfg.port} \
|
"--port" cfg.port
|
||||||
${concatStringsSep " " cfg.controlSocketPaths}
|
] ++ cfg.extraFlags ++ cfg.targets);
|
||||||
'';
|
|
||||||
RuntimeDirectory = "kea";
|
RuntimeDirectory = "kea";
|
||||||
RuntimeDirectoryPreserve = true;
|
RuntimeDirectoryPreserve = true;
|
||||||
RestrictAddressFamilies = [
|
RestrictAddressFamilies = [
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.exporters.mysqld;
|
cfg = config.services.prometheus.exporters.mysqld;
|
||||||
inherit (lib) types mkOption mdDoc mkIf mkForce cli concatStringsSep optionalString escapeShellArgs;
|
inherit (lib) types mkOption mdDoc mkIf mkForce cli concatStringsSep optionalString escapeShellArgs;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
, options
|
, options
|
||||||
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.exporters.rtl_433;
|
cfg = config.services.prometheus.exporters.rtl_433;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
, options
|
, options
|
||||||
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.exporters.sql;
|
cfg = config.services.prometheus.exporters.sql;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
, options
|
, options
|
||||||
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, options }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -44,6 +44,11 @@ import ./make-test-python.nix ({ pkgs, lib, ...}: {
|
|||||||
name = "/var/lib/kea/dhcp4.leases";
|
name = "/var/lib/kea/dhcp4.leases";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
control-socket = {
|
||||||
|
socket-type = "unix";
|
||||||
|
socket-name = "/run/kea/dhcp4.sock";
|
||||||
|
};
|
||||||
|
|
||||||
interfaces-config = {
|
interfaces-config = {
|
||||||
dhcp-socket-type = "raw";
|
dhcp-socket-type = "raw";
|
||||||
interfaces = [
|
interfaces = [
|
||||||
@ -89,6 +94,25 @@ import ./make-test-python.nix ({ pkgs, lib, ...}: {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.kea.ctrl-agent = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
http-host = "127.0.0.1";
|
||||||
|
http-port = 8000;
|
||||||
|
control-sockets.dhcp4 = {
|
||||||
|
socket-type = "unix";
|
||||||
|
socket-name = "/run/kea/dhcp4.sock";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.prometheus.exporters.kea = {
|
||||||
|
enable = true;
|
||||||
|
controlSocketPaths = [
|
||||||
|
"http://127.0.0.1:8000"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nameserver = { config, pkgs, ... }: {
|
nameserver = { config, pkgs, ... }: {
|
||||||
@ -182,5 +206,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...}: {
|
|||||||
client.wait_until_succeeds("ping -c 5 10.0.0.1")
|
client.wait_until_succeeds("ping -c 5 10.0.0.1")
|
||||||
router.wait_until_succeeds("ping -c 5 10.0.0.3")
|
router.wait_until_succeeds("ping -c 5 10.0.0.3")
|
||||||
nameserver.wait_until_succeeds("kdig +short client.lan.nixos.test @10.0.0.2 | grep -q 10.0.0.3")
|
nameserver.wait_until_succeeds("kdig +short client.lan.nixos.test @10.0.0.2 | grep -q 10.0.0.3")
|
||||||
|
router.log(router.execute("curl 127.0.0.1:9547")[1])
|
||||||
|
router.succeed("curl --no-buffer 127.0.0.1:9547 | grep -qE '^kea_dhcp4_addresses_assigned_total.*1.0$'")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
@ -418,54 +418,6 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
kea = let
|
|
||||||
controlSocketPathV4 = "/run/kea/dhcp4.sock";
|
|
||||||
controlSocketPathV6 = "/run/kea/dhcp6.sock";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
exporterConfig = {
|
|
||||||
enable = true;
|
|
||||||
controlSocketPaths = [
|
|
||||||
controlSocketPathV4
|
|
||||||
controlSocketPathV6
|
|
||||||
];
|
|
||||||
};
|
|
||||||
metricProvider = {
|
|
||||||
services.kea = {
|
|
||||||
dhcp4 = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
control-socket = {
|
|
||||||
socket-type = "unix";
|
|
||||||
socket-name = controlSocketPathV4;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
dhcp6 = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
control-socket = {
|
|
||||||
socket-type = "unix";
|
|
||||||
socket-name = controlSocketPathV6;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
exporterTest = ''
|
|
||||||
wait_for_unit("kea-dhcp4-server.service")
|
|
||||||
wait_for_unit("kea-dhcp6-server.service")
|
|
||||||
wait_for_file("${controlSocketPathV4}")
|
|
||||||
wait_for_file("${controlSocketPathV6}")
|
|
||||||
wait_for_unit("prometheus-kea-exporter.service")
|
|
||||||
wait_for_open_port(9547)
|
|
||||||
succeed(
|
|
||||||
"curl --fail localhost:9547/metrics | grep 'packets_received_total'"
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
knot = {
|
knot = {
|
||||||
exporterConfig = {
|
exporterConfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "kea-exporter";
|
pname = "kea-exporter";
|
||||||
version = "0.6.1";
|
version = "0.7.0";
|
||||||
format = "pyproject";
|
format = "pyproject";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchPypi {
|
||||||
pname = "kea_exporter";
|
pname = "kea_exporter";
|
||||||
inherit version;
|
inherit version;
|
||||||
hash = "sha256-PyNFSTDqT+PBY7d9NSG1FVhN+Y3ID13T6859kBYsFzU=";
|
hash = "sha256-kn2iwYWcyW90tgfWmzLF7rU06fJyLRzqYKNLOgu/Yqk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = with python3Packages; [
|
nativeBuildInputs = with python3Packages; [
|
||||||
@ -31,7 +31,7 @@ python3Packages.buildPythonApplication rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
inherit (nixosTests.prometheus-exporters) kea;
|
inherit (nixosTests) kea;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
Loading…
Reference in New Issue
Block a user