Merge pull request #297622 from mweinelt/kea-exporter-0.7.0

kea-exporter: 0.6.1 -> 0.7.0

+3 -3
nixos/modules/services/monitoring/prometheus/exporters.nix
···
-
{ config, pkgs, lib, options, ... }:
+
{ config, pkgs, lib, options, utils, ... }:
let
inherit (lib) concatStrings foldl foldl' genAttrs literalExpression maintainers
···
"zfs"
]
(name:
-
import (./. + "/exporters/${name}.nix") { inherit config lib pkgs options; }
+
import (./. + "/exporters/${name}.nix") { inherit config lib pkgs options utils; }
)) // (mapAttrs
(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 = {
name = "exportarr";
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/apcupsd.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/bind.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/bird.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/blackbox.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/buildkite-agent.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/collectd.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/dmarc.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/dnsmasq.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/domain.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/exportarr.nix
···
-
{ config, lib, pkgs, options, type }:
+
{ config, lib, pkgs, options, type, ... }:
let
cfg = config.services.prometheus.exporters."exportarr-${type}";
+1
nixos/modules/services/monitoring/prometheus/exporters/fastly.nix
···
, lib
, pkgs
, options
+
, ...
}:
let
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/flow.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/fritzbox.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/graphite.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
let
cfg = config.services.prometheus.exporters.graphite;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/idrac.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
let
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/imap-mailstat.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/influxdb.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/ipmi.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/jitsi.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/json.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/junos-czerwonk.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+13 -9
nixos/modules/services/monitoring/prometheus/exporters/kea.nix
···
{ config
, lib
, pkgs
-
, options
+
, utils
+
, ...
}:
with lib;
···
let
cfg = config.services.prometheus.exporters.kea;
in {
+
imports = [
+
(mkRenamedOptionModule [ "controlSocketPaths" ] [ "targets" ])
+
];
port = 9547;
extraOpts = {
-
controlSocketPaths = mkOption {
+
targets = mkOption {
type = types.listOf types.str;
example = literalExpression ''
[
"/run/kea/kea-dhcp4.socket"
"/run/kea/kea-dhcp6.socket"
+
"http://127.0.0.1:8547"
]
'';
description = lib.mdDoc ''
-
Paths to kea control sockets
+
Paths or URLs to the Kea control socket.
'';
};
};
···
serviceConfig = {
User = "kea";
DynamicUser = true;
-
ExecStart = ''
-
${pkgs.prometheus-kea-exporter}/bin/kea-exporter \
-
--address ${cfg.listenAddress} \
-
--port ${toString cfg.port} \
-
${concatStringsSep " " cfg.controlSocketPaths}
-
'';
+
ExecStart = utils.escapeSystemdExecArgs ([
+
(lib.getExe pkgs.prometheus-kea-exporter)
+
"--address" cfg.listenAddress
+
"--port" cfg.port
+
] ++ cfg.extraFlags ++ cfg.targets);
RuntimeDirectory = "kea";
RuntimeDirectoryPreserve = true;
RestrictAddressFamilies = [
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/keylight.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/knot.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/lnd.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/mail.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/mikrotik.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/minio.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/modemmanager.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/mongodb.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/mysqld.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
let
cfg = config.services.prometheus.exporters.mysqld;
inherit (lib) types mkOption mdDoc mkIf mkForce cli concatStringsSep optionalString escapeShellArgs;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/nginx.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/node.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/nut.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/pgbouncer.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1
nixos/modules/services/monitoring/prometheus/exporters/php-fpm.nix
···
, lib
, pkgs
, options
+
, ...
}:
let
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/pihole.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/ping.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/postgres.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/process.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/pve.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
let
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/redis.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/restic.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
let
cfg = config.services.prometheus.exporters.rtl_433;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/sabnzbd.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
let
inherit (lib) mkOption types;
+1
nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix
···
, lib
, pkgs
, options
+
, ...
}:
let
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/script.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/shelly.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/smokeping.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/snmp.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/sql.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
let
cfg = config.services.prometheus.exporters.sql;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/statsd.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/surfboard.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/tor.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1
nixos/modules/services/monitoring/prometheus/exporters/unbound.nix
···
, lib
, pkgs
, options
+
, ...
}:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/unifi.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/unpoller.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/v2ray.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/varnish.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/zfs.nix
···
-
{ config, lib, pkgs, options }:
+
{ config, lib, pkgs, options, ... }:
with lib;
+26
nixos/tests/kea.nix
···
name = "/var/lib/kea/dhcp4.leases";
};
+
control-socket = {
+
socket-type = "unix";
+
socket-name = "/run/kea/dhcp4.sock";
+
};
+
interfaces-config = {
dhcp-socket-type = "raw";
interfaces = [
···
} ];
};
};
+
};
+
+
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"
+
];
};
};
···
client.wait_until_succeeds("ping -c 5 10.0.0.1")
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")
+
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$'")
'';
})
-48
nixos/tests/prometheus-exporters.nix
···
'';
};
-
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 = {
exporterConfig = {
enable = true;
+3 -3
pkgs/servers/monitoring/prometheus/kea-exporter.nix
···
python3Packages.buildPythonApplication rec {
pname = "kea-exporter";
-
version = "0.6.1";
+
version = "0.7.0";
format = "pyproject";
src = fetchPypi {
pname = "kea_exporter";
inherit version;
-
hash = "sha256-PyNFSTDqT+PBY7d9NSG1FVhN+Y3ID13T6859kBYsFzU=";
+
hash = "sha256-kn2iwYWcyW90tgfWmzLF7rU06fJyLRzqYKNLOgu/Yqk=";
};
nativeBuildInputs = with python3Packages; [
···
'';
passthru.tests = {
-
inherit (nixosTests.prometheus-exporters) kea;
+
inherit (nixosTests) kea;
};
meta = with lib; {