From bae2759a377283f44aa95facf4732101819f16c1 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 5 Mar 2021 13:06:20 +0100 Subject: [PATCH] prometheus-knot-exporter: init at 2020-01-30 --- .../monitoring/prometheus/knot-exporter.nix | 37 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 38 insertions(+) create mode 100644 pkgs/servers/monitoring/prometheus/knot-exporter.nix diff --git a/pkgs/servers/monitoring/prometheus/knot-exporter.nix b/pkgs/servers/monitoring/prometheus/knot-exporter.nix new file mode 100644 index 000000000000..32722ff55931 --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/knot-exporter.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchFromGitHub, lib, python3 }: + +stdenv.mkDerivation rec { + pname = "knot-exporter-unstable"; + version = "2020-01-30"; + + src = fetchFromGitHub { + owner = "ghedo"; + repo = "knot_exporter"; + rev = "21dd46b401e0c1aea0b173e19462cdf89e1f444e"; + sha256 = "sha256-4au4lpaq3jcqC2JXdCcf8h+YN8Nmm4eE0kZwA+1rWlc="; + }; + + dontBuild = true; + + nativeBuildInputs = [ python3.pkgs.wrapPython ]; + buildInputs = [ python3 ]; + + installPhase = '' + runHook preInstall + + install -Dm0755 knot_exporter $out/bin/knot_exporter + patchShebangs $out/bin + buildPythonPath ${python3.pkgs.prometheus_client} + patchPythonScript $out/bin/knot_exporter + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/ghedo/knot_exporter"; + description = " Prometheus exporter for Knot DNS"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ ma27 ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c38af6eced2d..c14dd037df07 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18533,6 +18533,7 @@ in prometheus-haproxy-exporter = callPackage ../servers/monitoring/prometheus/haproxy-exporter.nix { }; prometheus-json-exporter = callPackage ../servers/monitoring/prometheus/json-exporter.nix { }; prometheus-keylight-exporter = callPackage ../servers/monitoring/prometheus/keylight-exporter.nix { }; + prometheus-knot-exporter = callPackage ../servers/monitoring/prometheus/knot-exporter.nix { }; prometheus-lnd-exporter = callPackage ../servers/monitoring/prometheus/lnd-exporter.nix { }; prometheus-mail-exporter = callPackage ../servers/monitoring/prometheus/mail-exporter.nix { }; prometheus-mesos-exporter = callPackage ../servers/monitoring/prometheus/mesos-exporter.nix { };