diff --git a/pkgs/servers/monitoring/prometheus/ipmi-exporter.nix b/pkgs/servers/monitoring/prometheus/ipmi-exporter.nix new file mode 100644 index 000000000000..e2ee9ae4e59f --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/ipmi-exporter.nix @@ -0,0 +1,41 @@ +{ lib, buildGoModule, fetchFromGitHub, nixosTests, makeWrapper, freeipmi }: + +buildGoModule rec { + pname = "ipmi_exporter"; + version = "1.6.1"; + + src = fetchFromGitHub { + owner = "prometheus-community"; + repo = "ipmi_exporter"; + rev = "v${version}"; + hash = "sha256-hifG1lpFUVLoy7Ol3N6h+s+hZjnQxja5svpY4lFFsxw="; + }; + + vendorHash = "sha256-UuPZmxoKVj7FusOS6H1gn6SAzQIZAKyX+m+QS657yXw="; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram $out/bin/ipmi_exporter --prefix PATH : ${lib.makeBinPath [ freeipmi ]} + ''; + + passthru.tests = { inherit (nixosTests.prometheus-exporters) ipmi; }; + + ldflags = [ + "-s" + "-w" + "-X github.com/prometheus/common/version.Version=${version}" + "-X github.com/prometheus/common/version.Revision=0000000" + "-X github.com/prometheus/common/version.Branch=unknown" + "-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs" + "-X github.com/prometheus/common/version.BuildDate=unknown" + ]; + + meta = with lib; { + description = "An IPMI exporter for Prometheus"; + homepage = "https://github.com/prometheus-community/ipmi_exporter"; + changelog = "https://github.com/prometheus-community/ipmi_exporter/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ snaar ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 194ed0d59d7f..f9fce58ec936 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23302,6 +23302,7 @@ with pkgs; prometheus-gitlab-ci-pipelines-exporter = callPackage ../servers/monitoring/prometheus/gitlab-ci-pipelines-exporter.nix { }; prometheus-haproxy-exporter = callPackage ../servers/monitoring/prometheus/haproxy-exporter.nix { }; prometheus-influxdb-exporter = callPackage ../servers/monitoring/prometheus/influxdb-exporter.nix { }; + prometheus-ipmi-exporter = callPackage ../servers/monitoring/prometheus/ipmi-exporter.nix { }; prometheus-jitsi-exporter = callPackage ../servers/monitoring/prometheus/jitsi-exporter.nix { }; prometheus-jmx-httpserver = callPackage ../servers/monitoring/prometheus/jmx-httpserver.nix { }; prometheus-json-exporter = callPackage ../servers/monitoring/prometheus/json-exporter.nix { };