From 735662bf16490b20d7b5206a633bed14c1d50b1c Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 1 Sep 2024 16:47:45 +0200 Subject: [PATCH] prometheus-openldap-exporter: remove 2.3.0 is the final release, the repo is now archived. Also I don't use it anymore for quite a while, so it didn't have a real nixpkgs maintainer either. Closes #338712 --- .../manual/release-notes/rl-2411.section.md | 2 + .../monitoring/prometheus/exporters.nix | 1 - .../prometheus/exporters/openldap.nix | 66 ------------------- nixos/tests/prometheus-exporters.nix | 60 ----------------- .../prometheus/openldap-exporter.nix | 31 --------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 1 - 7 files changed, 3 insertions(+), 159 deletions(-) delete mode 100644 nixos/modules/services/monitoring/prometheus/exporters/openldap.nix delete mode 100644 pkgs/servers/monitoring/prometheus/openldap-exporter.nix diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index a471d605a454..f336b8b996cf 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -431,6 +431,8 @@ - The `shadowstack` hardening flag has been added, though disabled by default. +- `prometheus-openldap-exporter` was removed since it was unmaintained upstream and had no nixpkgs maintainers. + - `restic` module now has an option for inhibiting system sleep while backups are running, defaulting to off (not inhibiting sleep), available as [`services.restic.backups..inhibitsSleep`](#opt-services.restic.backups._name_.inhibitsSleep). - Support for *runner registration tokens* has been [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/380872) diff --git a/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixos/modules/services/monitoring/prometheus/exporters.nix index 7b02e815cdbb..1471f97f1c24 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters.nix @@ -63,7 +63,6 @@ let "nginxlog" "node" "nut" - "openldap" "pgbouncer" "php-fpm" "pihole" diff --git a/nixos/modules/services/monitoring/prometheus/exporters/openldap.nix b/nixos/modules/services/monitoring/prometheus/exporters/openldap.nix deleted file mode 100644 index bb65bd270933..000000000000 --- a/nixos/modules/services/monitoring/prometheus/exporters/openldap.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.services.prometheus.exporters.openldap; - inherit (lib) mkOption types concatStringsSep; -in { - port = 9330; - extraOpts = { - ldapCredentialFile = mkOption { - type = types.path; - example = "/run/keys/ldap_pass"; - description = '' - Environment file to contain the credentials to authenticate against - `openldap`. - - The file should look like this: - ``` - --- - ldapUser: "cn=monitoring,cn=Monitor" - ldapPass: "secret" - ``` - ''; - }; - protocol = mkOption { - default = "tcp"; - example = "udp"; - type = types.str; - description = '' - Which protocol to use to connect against `openldap`. - ''; - }; - ldapAddr = mkOption { - default = "localhost:389"; - type = types.str; - description = '' - Address of the `openldap`-instance. - ''; - }; - metricsPath = mkOption { - default = "/metrics"; - type = types.str; - description = '' - URL path where metrics should be exposed. - ''; - }; - interval = mkOption { - default = "30s"; - type = types.str; - example = "1m"; - description = '' - Scrape interval of the exporter. - ''; - }; - }; - serviceOpts.serviceConfig = { - ExecStart = '' - ${pkgs.prometheus-openldap-exporter}/bin/openldap_exporter \ - --promAddr ${cfg.listenAddress}:${toString cfg.port} \ - --metrPath ${cfg.metricsPath} \ - --ldapNet ${cfg.protocol} \ - --interval ${cfg.interval} \ - --config ${cfg.ldapCredentialFile} \ - ${concatStringsSep " \\\n " cfg.extraFlags} - ''; - }; -} diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 6a4abab7cc12..4cc65b87137a 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -932,66 +932,6 @@ let ''; }; - openldap = { - exporterConfig = { - enable = true; - ldapCredentialFile = "${pkgs.writeText "exporter.yml" '' - ldapUser: "cn=root,dc=example" - ldapPass: "notapassword" - ''}"; - }; - metricProvider = { - services.openldap = { - enable = true; - settings.children = { - "cn=schema".includes = [ - "${pkgs.openldap}/etc/schema/core.ldif" - "${pkgs.openldap}/etc/schema/cosine.ldif" - "${pkgs.openldap}/etc/schema/inetorgperson.ldif" - "${pkgs.openldap}/etc/schema/nis.ldif" - ]; - "olcDatabase={1}mdb" = { - attrs = { - objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ]; - olcDatabase = "{1}mdb"; - olcDbDirectory = "/var/lib/openldap/db"; - olcSuffix = "dc=example"; - olcRootDN = { - # cn=root,dc=example - base64 = "Y249cm9vdCxkYz1leGFtcGxl"; - }; - olcRootPW = { - path = "${pkgs.writeText "rootpw" "notapassword"}"; - }; - }; - }; - "olcDatabase={2}monitor".attrs = { - objectClass = [ "olcDatabaseConfig" ]; - olcDatabase = "{2}monitor"; - olcAccess = [ "to dn.subtree=cn=monitor by users read" ]; - }; - }; - declarativeContents."dc=example" = '' - dn: dc=example - objectClass: domain - dc: example - - dn: ou=users,dc=example - objectClass: organizationalUnit - ou: users - ''; - }; - }; - exporterTest = '' - wait_for_unit("prometheus-openldap-exporter.service") - wait_for_open_port(389) - wait_for_open_port(9330) - wait_until_succeeds( - "curl -sSf http://localhost:9330/metrics | grep 'openldap_scrape{result=\"ok\"} 1'" - ) - ''; - }; - pgbouncer = { exporterConfig = { enable = true; diff --git a/pkgs/servers/monitoring/prometheus/openldap-exporter.nix b/pkgs/servers/monitoring/prometheus/openldap-exporter.nix deleted file mode 100644 index 49181699d65a..000000000000 --- a/pkgs/servers/monitoring/prometheus/openldap-exporter.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ lib, buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "openldap_exporter"; - version = "2.2.2"; - - src = fetchFromGitHub { - owner = "tomcz"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-1u+89odwV/lz34wtrK91lET2bOqkH6kRA7JCjzsmiEg="; - }; - - vendorHash = null; - - ldflags = [ - "-s" - "-w" - "-X github.com/tomcz/openldap_exporter.tag=v${version}" - "-X github.com/tomcz/openldap_exporter.commit=unknown" - ]; - - - meta = with lib; { - homepage = "https://github.com/tomcz/openldap_exporter"; - description = "Simple service that scrapes metrics from OpenLDAP and exports them via HTTP for Prometheus consumption"; - mainProgram = "openldap_exporter"; - license = licenses.mit; - maintainers = with maintainers; [ ma27 ]; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 65ac0671b249..e28f80f34a96 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1238,6 +1238,7 @@ mapAliases ({ processing3 = throw "'processing3' has been renamed to/replaced by 'processing'"; # Converted to throw 2023-09-10 prometheus-dmarc-exporter = dmarc-metrics-exporter; # added 2022-05-31 prometheus-dovecot-exporter = dovecot_exporter; # Added 2024-06-10 + prometheus-openldap-exporter = throw "'prometheus-openldap-exporter' has been removed from nixpkgs, as it was unmaintained"; # Added 2024-09-01 prometheus-openvpn-exporter = throw "'prometheus-openvpn-exporter' has been removed from nixpkgs, as it was broken and unmaintained"; # Added 2023-12-23 prometheus-minio-exporter = throw "'prometheus-minio-exporter' has been removed from nixpkgs, use Minio's built-in Prometheus integration instead"; # Added 2024-06-10 prometheus-speedtest-exporter = throw "prometheus-speedtest-exporter was removed as unmaintained"; # Added 2023-07-31 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f224b59658bf..d33a3225baaf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25611,7 +25611,6 @@ with pkgs; prometheus-nginx-exporter = callPackage ../servers/monitoring/prometheus/nginx-exporter.nix { }; prometheus-nginxlog-exporter = callPackage ../servers/monitoring/prometheus/nginxlog-exporter.nix { }; prometheus-nut-exporter = callPackage ../servers/monitoring/prometheus/nut-exporter.nix { }; - prometheus-openldap-exporter = callPackage ../servers/monitoring/prometheus/openldap-exporter.nix { } ; prometheus-pgbouncer-exporter = callPackage ../servers/monitoring/prometheus/pgbouncer-exporter.nix { }; prometheus-php-fpm-exporter = callPackage ../servers/monitoring/prometheus/php-fpm-exporter.nix { }; prometheus-pihole-exporter = callPackage ../servers/monitoring/prometheus/pihole-exporter.nix { };