push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
{
lib,
go,
buildGoModule,
fetchFromGitHub,
installShellFiles,
nixosTests,
}:
buildGoModule rec {
pname = "alertmanager";
version = "0.28.1";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "alertmanager";
hash = "sha256-2HHQ7S1J/X4PVFnPbi8Oapsqf1MyNnsqfMMBJRItWf0=";
};
vendorHash = "sha256-4XWHe32UZ+1HOQzQdZX4leoPD6pfJZwyjDQV3dv164s=";
subPackages = [
"cmd/alertmanager"
"cmd/amtool"
];
ldflags =
let
t = "github.com/prometheus/common/version";
in
[
"-X ${t}.Version=${version}"
"-X ${t}.Revision=${src.rev}"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
"-X ${t}.GoVersion=${lib.getVersion go}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$out/bin/amtool --completion-script-bash > amtool.bash
installShellCompletion amtool.bash
$out/bin/amtool --completion-script-zsh > amtool.zsh
installShellCompletion amtool.zsh
'';
passthru.tests = { inherit (nixosTests.prometheus) alertmanager; };
meta = with lib; {
description = "Alert dispatcher for the Prometheus monitoring system";
homepage = "https://github.com/prometheus/alertmanager";
changelog = "https://github.com/prometheus/alertmanager/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = with maintainers; [
benley
fpletz
globin
Frostman
];
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "apcupsd-exporter";
version = "0.3.0";
src = fetchFromGitHub {
owner = "mdlayher";
repo = "apcupsd_exporter";
rev = "v${version}";
sha256 = "sha256-c0LsUqpJbmWQmbmSGdEy7Bbk20my6iWNLeqtU5BjYlw=";
};
vendorHash = "sha256-bvLwHLviIAGmxYY1O0wFDWAMginEUklicrbjIbbPuUw=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) apcupsd; };
meta = with lib; {
description = "Provides a Prometheus exporter for the apcupsd Network Information Server (NIS)";
mainProgram = "apcupsd_exporter";
homepage = "https://github.com/mdlayher/apcupsd_exporter";
license = licenses.mit;
maintainers = with maintainers; [
_1000101
mdlayher
];
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "artifactory_exporter";
version = "1.16.1";
rev = "v${version}";
src = fetchFromGitHub {
owner = "peimanja";
repo = pname;
rev = rev;
hash = "sha256-ffICacOaYD3/wB38qQ/qYOfDwQxe1tndRdR2BHxolcA=";
};
vendorHash = "sha256-zTuqSPjKJng7Gf/RHo4KYpSzlGRrOVa/AEpz7ZDePyc=";
subPackages = [ "." ];
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=${rev}"
"-X github.com/prometheus/common/version.Branch=master"
"-X github.com/prometheus/common/version.BuildDate=19700101-00:00:00"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) artifactory; };
meta = with lib; {
description = "JFrog Artifactory Prometheus Exporter";
mainProgram = "artifactory_exporter";
homepage = "https://github.com/peimanja/artifactory_exporter";
changelog = "https://github.com/peimanja/artifactory_exporter/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ lbpdt ];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "atlas-exporter";
version = "1.0.4";
src = fetchFromGitHub {
owner = "czerwonk";
repo = "atlas_exporter";
rev = version;
sha256 = "sha256-vhUhWO7fQpUHT5nyxbT8AylgUqDNZRSb+EGRNGZJ14E=";
};
vendorHash = "sha256-tR+OHxj/97AixuAp0Kx9xQsKPAxpvF6hDha5BgMBha0=";
meta = with lib; {
description = "Prometheus exporter for RIPE Atlas measurement results";
mainProgram = "atlas_exporter";
homepage = "https://github.com/czerwonk/atlas_exporter";
license = licenses.lgpl3;
maintainers = with maintainers; [ clerie ];
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "aws-s3-exporter";
version = "0.5.0";
src = fetchFromGitHub {
owner = "ribbybibby";
repo = "s3_exporter";
rev = "v${version}";
sha256 = "sha256-dYkMCCAIlFDFOFUNJd4NvtAeJDTsHeJoH90b5pSGlQE=";
};
vendorHash = null;
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "Exports Prometheus metrics about S3 buckets and objects";
mainProgram = "s3_exporter";
homepage = "https://github.com/ribbybibby/s3_exporter";
license = licenses.asl20;
maintainers = [ maintainers.mmahut ];
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "bind_exporter";
version = "0.7.0";
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus-community";
repo = "bind_exporter";
sha256 = "sha256-x/XGatlXCKo9cI92JzFItApsjuZAfZX+8IZRpy7PVUo=";
};
vendorHash = "sha256-f0ei/zotOj5ebURAOWUox/7J3jS2abQ5UgjninI9nRk=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) bind; };
meta = with lib; {
description = "Prometheus exporter for bind9 server";
mainProgram = "bind_exporter";
homepage = "https://github.com/digitalocean/bind_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ rtreffer ];
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "bird-exporter";
version = "1.4.3";
src = fetchFromGitHub {
owner = "czerwonk";
repo = "bird_exporter";
rev = version;
sha256 = "sha256-aClwJ+J83iuZbfNP+Y1vKEjBULD5wh/R3TMceCccacc=";
};
vendorHash = "sha256-0EXRpehdpOYpq6H9udmNnQ24EucvAcPUKOlFSAAewbE=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) bird; };
meta = with lib; {
description = "Prometheus exporter for the bird routing daemon";
mainProgram = "bird_exporter";
homepage = "https://github.com/czerwonk/bird_exporter";
license = licenses.mit;
maintainers = with maintainers; [ lukegb ];
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
fetchFromGitHub,
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "bitcoin-prometheus-exporter";
version = "0.9.0";
format = "other";
src = fetchFromGitHub {
owner = "jvstein";
repo = pname;
tag = "v${version}";
sha256 = "sha256-08QG/5Kj++rjWz7OciqKSJUk00lSJCbfB5XwwP+h4so=";
};
# Copying bitcoind-monitor.py is enough.
# The makefile builds docker containers.
dontBuild = true;
propagatedBuildInputs = with python3Packages; [
prometheus-client
python-bitcoinlib
riprova
];
installPhase = ''
mkdir -p $out/bin
cp bitcoind-monitor.py $out/bin/
mkdir -p $out/share/${pname}
cp -r dashboard README.md $out/share/${pname}/
'';
meta = with lib; {
description = "Prometheus exporter for Bitcoin Core nodes";
mainProgram = "bitcoind-monitor.py";
homepage = "https://github.com/jvstein/bitcoin-prometheus-exporter";
license = licenses.bsd3;
maintainers = with maintainers; [ mmilata ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "blackbox_exporter";
version = "0.27.0";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "blackbox_exporter";
sha256 = "sha256-oIsNqET3gHSajyWTxc+zoLiKQNCIXK77jtthOwYVtQg=";
};
vendorHash = "sha256-UHm3iIQ6/clPx/VBUG4j/WLoOhFN44nbAEZk94L/9EY=";
# dns-lookup is performed for the tests
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) blackbox; };
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=${rev}"
"-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 = "Blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP";
mainProgram = "blackbox_exporter";
homepage = "https://github.com/prometheus/blackbox_exporter";
license = licenses.asl20;
maintainers = with maintainers; [
globin
fpletz
Frostman
ma27
];
};
}

View File

@@ -0,0 +1,28 @@
{
buildGoModule,
fetchFromGitHub,
lib,
}:
buildGoModule rec {
pname = "cloudflare-exporter";
version = "0.0.16";
src = fetchFromGitHub {
rev = version;
owner = "lablabs";
repo = pname;
sha256 = "sha256-7cyHAN4VQWfWMdlFbZvHL38nIEeC1z/vpCDR5R2pOAw=";
};
vendorHash = "sha256-c1drgbzoA5AlbB0K+E8kuJnyShgUg7spPQKAAwxCr6M=";
meta = with lib; {
description = "Prometheus Cloudflare Exporter";
mainProgram = "cloudflare-exporter";
homepage = "https://github.com/lablabs/cloudflare-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ bbigras ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "collectd-exporter";
version = "0.7.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "collectd_exporter";
rev = "v${version}";
sha256 = "sha256-MxgHJ9+e94ReY/8ISPfGEX9Z9ZHDyNsV0AqlPfsjXvc=";
};
vendorHash = "sha256-kr8mHprIfXc/Yj/w2UKBkqIYZHmWtBLjqYDvKSXlozQ=";
ldflags = [
"-s"
"-w"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) collectd; };
meta = with lib; {
description = "Relay server for exporting metrics from collectd to Prometheus";
mainProgram = "collectd_exporter";
homepage = "https://github.com/prometheus/collectd_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley ];
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "consul_exporter";
version = "0.13.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "consul_exporter";
rev = "refs/tags/v${version}";
hash = "sha256-2X1nJIUwp7kqqz/D3x4bq6vHg1N8zC9AWCn02qsAyAQ=";
};
vendorHash = "sha256-z9+WrJDgjQYf4G90sdqY+SOGJa/r5Ie9GFVrihbaGGU=";
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "Prometheus exporter for Consul metrics";
mainProgram = "consul_exporter";
homepage = "https://github.com/prometheus/consul_exporter";
changelog = "https://github.com/prometheus/consul_exporter/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ hectorj ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
stdenv,
}:
buildGoModule rec {
pname = "dnsmasq_exporter";
version = "0.3.0";
src = fetchFromGitHub {
owner = "google";
repo = "dnsmasq_exporter";
rev = "v${version}";
hash = "sha256-2sOOJWEEseWwozIyZ7oes400rBjlxIrOOtkP3rSNFXo=";
};
vendorHash = "sha256-oD68TCNJKwjY3iwE/pUosMIMGOhsWj9cHC/+hq3xxI4=";
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) dnsmasq; };
meta = with lib; {
inherit (src.meta) homepage;
description = "Dnsmasq exporter for Prometheus";
mainProgram = "dnsmasq_exporter";
license = licenses.asl20;
maintainers = with maintainers; [
globin
];
# Broken on darwin for Go toolchain > 1.22, with error:
# 'link: golang.org/x/net/internal/socket: invalid reference to syscall.recvmsg'
broken = stdenv.hostPlatform.isDarwin;
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "domain-exporter";
version = "1.24.1";
src = fetchFromGitHub {
owner = "caarlos0";
repo = "domain_exporter";
rev = "v${version}";
hash = "sha256-qk/shaWY7M2JDx6W4e7z8Nv7yWUZKZNGZE/mj4zCZHw=";
};
vendorHash = "sha256-1j5alRdCbO/ZJhuvVuiSsNBMRm7RqMOY/ex6US7qaxU=";
doCheck = false; # needs internet connection
passthru.tests = { inherit (nixosTests.prometheus-exporters) domain; };
meta = with lib; {
homepage = "https://github.com/caarlos0/domain_exporter";
description = "Exports the expiration time of your domains as prometheus metrics";
mainProgram = "domain_exporter";
license = licenses.mit;
maintainers = with maintainers; [
mmilata
peterhoeg
caarlos0
];
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "fastly-exporter";
version = "9.5.0";
src = fetchFromGitHub {
owner = "fastly";
repo = "fastly-exporter";
rev = "v${version}";
hash = "sha256-W3VVnI83RKwNkQj4njvZS+ANklNR27BWIrJmdcmSq2I=";
};
vendorHash = "sha256-wbkm6b8xTGAQ4bCjIOVvJVA7sckPxtDiwMcjglaL/Pk=";
passthru.tests = {
inherit (nixosTests.prometheus-exporters) fastly;
};
meta = with lib; {
description = "Prometheus exporter for the Fastly Real-time Analytics API";
homepage = "https://github.com/fastly/fastly-exporter";
license = licenses.asl20;
teams = [ teams.deshaw ];
mainProgram = "fastly-exporter";
};
}

View File

@@ -0,0 +1,28 @@
{
buildGoModule,
fetchFromGitHub,
lib,
}:
buildGoModule rec {
pname = "flow-exporter";
version = "1.1.1";
src = fetchFromGitHub {
rev = "v${version}";
owner = "neptune-networks";
repo = pname;
sha256 = "sha256-6FqupoYWRvex7XhM7ly8f7ICnuS9JvCRIVEBIJe+64k=";
};
vendorHash = "sha256-2raOUOPiMUMydIsfSsnwUAAiM7WyMio1NgL1EoADr2s=";
meta = with lib; {
description = "Export network flows from kafka to Prometheus";
mainProgram = "flow-exporter";
homepage = "https://github.com/neptune-networks/flow-exporter";
license = licenses.mit;
maintainers = with maintainers; [ kloenk ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule {
pname = "fritzbox-exporter";
version = "unstable-2021-04-13";
src = fetchFromGitHub {
rev = "fd36539bd7db191b3734e17934b5f1e78e4e9829";
owner = "mxschmitt";
repo = "fritzbox_exporter";
hash = "sha256-NtxgOGoFZjvNCn+alZF9Ngen4Z0nllR/NTgY5ixrL3E=";
};
vendorHash = "sha256-VhQAEVxRJjIzFP67LUKhfGxdUbTQB7UCK8/JKwpoy0w=";
subPackages = [ "cmd/exporter" ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) fritzbox; };
meta = with lib; {
description = "Prometheus Exporter for FRITZ!Box (TR64 and UPnP)";
mainProgram = "exporter";
homepage = "https://github.com/mxschmitt/fritzbox_exporter";
license = licenses.asl20;
maintainers = with maintainers; [
bachp
flokli
sbruder
];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "gitlab-ci-pipelines-exporter";
version = "0.5.10";
src = fetchFromGitHub {
owner = "mvisonneau";
repo = pname;
rev = "v${version}";
sha256 = "sha256-G298u9bitEst8QzZd1/B6PTCNpGqq88Z8W8w67/cVkQ=";
};
subPackages = [ "cmd/${pname}" ];
ldflags = [
"-X main.version=v${version}"
];
vendorHash = "sha256-LPS0paXtzNAOFW8FUAFbcEcVTtp3WFh6N/f6tuFPT50=";
doCheck = true;
meta = with lib; {
description = "Prometheus / OpenMetrics exporter for GitLab CI pipelines insights";
mainProgram = "gitlab-ci-pipelines-exporter";
homepage = "https://github.com/mvisonneau/gitlab-ci-pipelines-exporter";
license = licenses.asl20;
maintainers = with maintainers; [
mmahut
mvisonneau
];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "graphite-exporter";
version = "0.16.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "graphite_exporter";
rev = "v${version}";
hash = "sha256-Dr7I4+gQXZYKUMnf/P9DgLYRb4SRaDnvqvDwHfMpAn0=";
};
vendorHash = "sha256-f/ZJi3C11O+xAfXo544tlJcAt0MnTknuRmw01JXj82k=";
checkFlags =
let
skippedTests = [
"TestBacktracking"
"TestInconsistentLabelsE2E"
"TestIssue111"
"TestIssue61"
"TestIssue90"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) graphite; };
meta = {
description = "Exporter for metrics exported in the Graphite plaintext protocol";
homepage = "https://github.com/prometheus/graphite_exporter";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.misterio77 ];
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "haproxy_exporter";
version = "0.15.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "haproxy_exporter";
rev = "v${version}";
sha256 = "sha256-hpZnMvHAAEbvzASK3OgfG34AhPkCdRM7eOm15PRemkA=";
};
vendorHash = "sha256-s9UVtV8N2SJ1ik864P6p2hPXJ2jstFY/XnWt9fuCDo0=";
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "HAProxy Exporter for the Prometheus monitoring system";
mainProgram = "haproxy_exporter";
homepage = "https://github.com/prometheus/haproxy_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley ];
};
}

View File

@@ -0,0 +1,39 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "idrac_exporter";
version = "unstable-2023-06-29";
src = fetchFromGitHub {
owner = "mrlhansen";
repo = "idrac_exporter";
rev = "3b311e0e6d602fb0938267287f425f341fbf11da";
sha256 = "sha256-N8wSjQE25TCXg/+JTsvQk3fjTBgfXTiSGHwZWFDmFKc=";
};
vendorHash = "sha256-iNV4VrdQONq7LXwAc6AaUROHy8TmmloUAL8EmuPtF/o=";
patches = [ ./idrac-exporter/config-from-environment.patch ];
ldflags = [
"-s"
"-w"
];
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) idrac; };
meta = with lib; {
inherit (src.meta) homepage;
description = "Simple iDRAC exporter for Prometheus";
mainProgram = "idrac_exporter";
license = licenses.mit;
maintainers = with maintainers; [ codec ];
};
}

View File

@@ -0,0 +1,100 @@
diff --git a/internal/config/config.go b/internal/config/config.go
index ba8f066..1c801cd 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -2,8 +2,11 @@ package config
import (
"encoding/base64"
+ "fmt"
"os"
+ "strconv"
"sync"
+
"github.com/mrlhansen/idrac_exporter/internal/logging"
"gopkg.in/yaml.v2"
)
@@ -17,9 +20,9 @@ type HostConfig struct {
type RootConfig struct {
mutex sync.Mutex
- Address string `yaml:"address"`
- Port uint `yaml:"port"`
- MetricsPrefix string `yaml:"metrics_prefix"`
+ Address string `yaml:"address"`
+ Port uint `yaml:"port"`
+ MetricsPrefix string `yaml:"metrics_prefix"`
Collect struct {
System bool `yaml:"system"`
Sensors bool `yaml:"sensors"`
@@ -28,9 +31,29 @@ type RootConfig struct {
Storage bool `yaml:"storage"`
Memory bool `yaml:"memory"`
} `yaml:"metrics"`
- Timeout uint `yaml:"timeout"`
- Retries uint `yaml:"retries"`
- Hosts map[string]*HostConfig `yaml:"hosts"`
+ Timeout uint `yaml:"timeout"`
+ Retries uint `yaml:"retries"`
+ Hosts map[string]*HostConfig `yaml:"hosts"`
+}
+
+func getEnv(envvar string, defvalue string) string {
+ value := os.Getenv(envvar)
+ if len(value) == 0 {
+ return defvalue
+ }
+ return value
+}
+
+func getEnvUint(envvar string, defvalue uint) uint {
+ value, err := strconv.Atoi(getEnv(envvar, fmt.Sprint(defvalue)))
+ if err != nil {
+ logging.Fatalf("Failed parse integer value: %s", err)
+ }
+ if value == 0 {
+ return defvalue
+ }
+
+ return uint(value)
}
func (config *RootConfig) GetHostCfg(target string) *HostConfig {
@@ -70,29 +93,29 @@ func ReadConfigFile(fileName string) {
}
if Config.Address == "" {
- Config.Address = "0.0.0.0"
+ Config.Address = getEnv("IDRAC_EXPORTER_LISTEN_ADDRESS", "0.0.0.0")
}
if Config.Port == 0 {
- Config.Port = 9348
+ Config.Port = getEnvUint("IDRAC_EXPORTER_LISTEN_PORT", 9348)
}
if Config.Timeout == 0 {
- Config.Timeout = 10
+ Config.Timeout = getEnvUint("IDRAC_EXPORTER_TIMEOUT", 10)
}
if Config.Retries == 0 {
- Config.Retries = 1
+ Config.Retries = getEnvUint("IDRAC_EXPORTER_RETRIES", 1)
+ }
+
+ if Config.MetricsPrefix == "" {
+ Config.MetricsPrefix = getEnv("IDRAC_EXPORTER_PREFIX", "idrac")
}
if len(Config.Hosts) == 0 {
parseError("missing section", "hosts")
}
- if Config.MetricsPrefix == "" {
- Config.MetricsPrefix = "idrac"
- }
-
for k, v := range Config.Hosts {
if v.Username == "" {
parseError("missing username for host", k)

View File

@@ -0,0 +1,31 @@
{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "imap-mailstat-exporter";
version = "0.0.1";
src = fetchFromGitHub {
owner = "bt909";
repo = "imap-mailstat-exporter";
rev = "refs/tags/v${version}";
hash = "sha256-aR/94C9SI+FPs3zg3bpexmgGYrhxghyHwpXj25x0yuw=";
};
vendorHash = "sha256-M5Ho4CiO5DC6mWzenXEo2pu0WLHj5S8AV3oEFwD31Sw=";
nativeBuildInputs = [ installShellFiles ];
meta = with lib; {
description = "Export Prometheus-style metrics about how many emails you have in your INBOX and in additional configured folders";
mainProgram = "imap-mailstat-exporter";
homepage = "https://github.com/bt909/imap-mailstat-exporter";
license = licenses.mit;
maintainers = with maintainers; [ raboof ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "influxdb_exporter";
version = "0.12.0";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "influxdb_exporter";
hash = "sha256-O3cH7fX29tr/rhsovoYnmTL6CE+sZQKGNj4mq1IV/5U=";
};
vendorHash = "sha256-RCf52lHpF4alljH/CNhCg+zgfvlYbO5WT2rFX63fyyo=";
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=${rev}"
"-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"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) influxdb; };
meta = with lib; {
description = "Prometheus exporter that accepts InfluxDB metrics";
mainProgram = "influxdb_exporter";
homepage = "https://github.com/prometheus/influxdb_exporter";
changelog = "https://github.com/prometheus/influxdb_exporter/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
makeWrapper,
freeipmi,
}:
buildGoModule rec {
pname = "ipmi_exporter";
version = "1.10.1";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = "ipmi_exporter";
rev = "v${version}";
hash = "sha256-U4vkOKxHKJyfsngn2JqZncq71BohBnGM7Z1hA79YhKA=";
};
vendorHash = "sha256-8ebarbsaHiufPEghgOlaRMouGdI1c1Yo8pjqG2bPdK8=";
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 = "IPMI exporter for Prometheus";
mainProgram = "ipmi_exporter";
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 ];
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
buildGoModule,
fetchgit,
nixosTests,
}:
buildGoModule rec {
pname = "jitsiexporter";
version = "0.2.18";
src = fetchgit {
url = "https://git.xsfx.dev/prometheus/jitsiexporter";
rev = "v${version}";
sha256 = "1cf46wp96d9dwlwlffcgbcr0v3xxxfdv6il0zqkm2i7cfsfw0skf";
};
vendorHash = null;
passthru.tests = { inherit (nixosTests.prometheus-exporters) jitsi; };
meta = with lib; {
description = "Export Jitsi Videobridge metrics to Prometheus";
mainProgram = "jitsiexporter";
homepage = "https://git.xsfx.dev/prometheus/jitsiexporter";
license = licenses.mit;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchurl,
jre,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "jmx-prometheus-httpserver";
version = "0.15.0";
jarName = "jmx_prometheus_httpserver-${version}-jar-with-dependencies.jar";
src = fetchurl {
url = "mirror://maven/io/prometheus/jmx/jmx_prometheus_httpserver/${version}/${jarName}";
sha256 = "0fr3svn8kjp7bq1wzbkvv5awylwn8b01bngj04zvk7fpzqpgs7mz";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
dontUnpack = true;
installPhase = ''
mkdir -p $out/libexec
mkdir -p $out/bin
cp $src $out/libexec/$jarName
makeWrapper "${jre}/bin/java" $out/bin/jmx_prometheus_httpserver --add-flags "-jar $out/libexec/$jarName"
'';
meta = with lib; {
homepage = "https://github.com/prometheus/jmx_exporter";
description = "Process for exposing JMX Beans via HTTP for Prometheus consumption";
mainProgram = "jmx_prometheus_httpserver";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.asl20;
maintainers = [ maintainers.offline ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "prometheus-json-exporter";
version = "0.7.0";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = "json_exporter";
rev = "v${version}";
sha256 = "sha256-Zeq4gbwGd16MkGQRL8+bq0Ns06Yg+H9GAEo3qaMGDbc=";
};
vendorHash = "sha256-41JsxA3CfQjiwZw/2KP4Re4g3gmexadHuN0lUP5rjdo=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) json; };
meta = with lib; {
description = "Prometheus exporter which scrapes remote JSON by JSONPath";
homepage = "https://github.com/prometheus-community/json_exporter";
license = licenses.asl20;
maintainers = [ ];
mainProgram = "json_exporter";
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "junos-czerwonk-exporter";
version = "0.14.4";
src = fetchFromGitHub {
owner = "czerwonk";
repo = "junos_exporter";
rev = version;
sha256 = "sha256-RCh81CHdFjJ6R/3wMons4v/xO+kvNa9ohnlWVGSkiyU=";
};
vendorHash = "sha256-zD5QkpyeqrmX0zGgdQg9yQQrX/+0Xz+Q04IzpO+Qc5Q=";
meta = with lib; {
description = "Exporter for metrics from devices running JunOS";
mainProgram = "junos_exporter";
homepage = "https://github.com/czerwonk/junos_exporter";
license = licenses.mit;
teams = [ teams.wdz ];
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
python3Packages,
fetchPypi,
nixosTests,
}:
python3Packages.buildPythonApplication rec {
pname = "kea-exporter";
version = "0.7.0";
format = "pyproject";
src = fetchPypi {
pname = "kea_exporter";
inherit version;
hash = "sha256-kn2iwYWcyW90tgfWmzLF7rU06fJyLRzqYKNLOgu/Yqk=";
};
nativeBuildInputs = with python3Packages; [
pdm-backend
];
propagatedBuildInputs = with python3Packages; [
click
prometheus-client
requests
];
checkPhase = ''
$out/bin/kea-exporter --help > /dev/null
$out/bin/kea-exporter --version | grep -q ${version}
'';
passthru.tests = {
inherit (nixosTests) kea;
};
meta = with lib; {
changelog = "https://github.com/mweinelt/kea-exporter/blob/v${version}/HISTORY";
description = "Export Kea Metrics in the Prometheus Exposition Format";
mainProgram = "kea-exporter";
homepage = "https://github.com/mweinelt/kea-exporter";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "keylight-exporter";
version = "0.2.0";
src = fetchFromGitHub {
owner = "mdlayher";
repo = "keylight_exporter";
rev = "v${version}";
sha256 = "sha256-yI1mmEb5SP2lbP37CpPxYITJL/nvd/mIwxB0RIQRe4I=";
};
vendorHash = "sha256-0QSsGgokErRNIHQIjZQn5t1dvc306uZck8uLSgjcrck=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) keylight; };
meta = with lib; {
homepage = "https://github.com/mdlayher/keylight_exporter";
description = "Prometheus exporter for Elgato Key Light devices";
mainProgram = "keylight_exporter";
license = licenses.mit;
maintainers = with maintainers; [ mdlayher ];
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
python3,
fetchPypi,
nixosTests,
}:
python3.pkgs.buildPythonApplication rec {
pname = "knot-exporter";
version = "3.5.0";
pyproject = true;
src = fetchPypi {
pname = "knot_exporter";
inherit version;
hash = "sha256-uFCIM+pZiJ6nvapEKjgHRrIuc5p5uq5q1ToD36e19zk=";
};
build-system = [
python3.pkgs.hatchling
];
dependencies = with python3.pkgs; [
libknot
prometheus-client
psutil
];
pythonImportsCheck = [
"knot_exporter"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) knot; };
meta = with lib; {
description = "Prometheus exporter for Knot DNS";
homepage = "https://gitlab.nic.cz/knot/knot-dns/-/tree/master/python/knot_exporter";
license = licenses.gpl2Plus;
maintainers = with maintainers; [
ma27
hexa
];
mainProgram = "knot-exporter";
};
}

View File

@@ -0,0 +1,41 @@
{
pkgs,
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "kthxbye";
version = "0.16";
src = fetchFromGitHub {
owner = "prymitive";
repo = "kthxbye";
rev = "v${version}";
hash = "sha256-B6AgD79q0kA67iC9pIfv8PH8xejx2srpRccdds1GsZo=";
};
vendorHash = "sha256-BS9+2w18tvrgmPzRMP0XyUlyPAR9AJMLXUd3GYEJr8E=";
buildPhase = ''
make -j$NIX_BUILD_CORES
'';
installPhase = ''
install -Dm755 ./kthxbye -t $out/bin
'';
passthru.tests = {
kthxbye = nixosTests.kthxbye;
};
meta = with lib; {
description = "Prometheus Alertmanager alert acknowledgement management daemon";
mainProgram = "kthxbye";
homepage = "https://github.com/prymitive/kthxbye";
license = licenses.asl20;
maintainers = with maintainers; [ nukaduka ];
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "lndmon";
version = "0.2.8";
src = fetchFromGitHub {
owner = "lightninglabs";
repo = "lndmon";
rev = "v${version}";
hash = "sha256-PzmDotyuG8Fgkr6SlBWofqQamDG39v65fFjRUKjIWWM=";
};
vendorHash = "sha256-6wBA9OZcjGsbIgWzMXlcT2571sFvtYqIsHRfLAz/o60=";
# Irrelevant tools dependencies.
excludedPackages = [ "./tools" ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) lnd; };
meta = with lib; {
homepage = "https://github.com/lightninglabs/lndmon";
description = "Prometheus exporter for lnd (Lightning Network Daemon)";
mainProgram = "lndmon";
license = licenses.mit;
maintainers = with maintainers; [ mmilata ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
nixosTests,
}:
buildGoModule {
pname = "mailexporter";
version = "2020-07-16";
src = fetchFromGitHub {
owner = "cherti";
repo = "mailexporter";
rev = "f5a552c736ac40ccdc0110d2e9a71619c1cd6862";
hash = "sha256-P7LZi2iXZJaY5AEJBeAVszq/DN9SFxNfeQaflnF6+ng=";
};
vendorHash = "sha256-QOOf00uCdC8fl7V/+Q8X90yQ7xc0Tb6M9dXisdGEisM=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage $src/man/mailexporter.1
installManPage $src/man/mailexporter.conf.5
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) mail; };
meta = with lib; {
description = "Export Prometheus-style metrics about mail server functionality";
mainProgram = "mailexporter";
homepage = "https://github.com/cherti/mailexporter";
license = licenses.gpl3;
maintainers = with maintainers; [
globin
];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "mikrotik-exporter-unstable";
version = "2021-08-10";
src = fetchFromGitHub {
owner = "nshttpd";
repo = "mikrotik-exporter";
rev = "4bfa7adfef500ff621a677adfab1f7010af920d1";
hash = "sha256-xmQTFx2BFBiKxRgfgGSG8h8nb18uviCAORS8VIILFu8=";
};
vendorHash = "sha256-rRIQo+367nHdtgfisBka0Yn6f4P75Mm3Ead4CscnRCw=";
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) mikrotik; };
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus MikroTik device(s) exporter";
mainProgram = "mikrotik-exporter";
license = licenses.bsd3;
maintainers = with maintainers; [ mmilata ];
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "modemmanager-exporter";
version = "0.2.0";
src = fetchFromGitHub {
owner = "mdlayher";
repo = "modemmanager_exporter";
rev = "v${version}";
sha256 = "sha256-wQATmTjYsm1J2DicPryoa/jVpbLjXz+1TTQUH5yGV6w=";
};
vendorHash = "sha256-wGCRpFnt9bxc5Ygg6H1kI9sXB4mVFBdLeaahAFtvNbg=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) modemmanager; };
meta = with lib; {
homepage = "https://github.com/mdlayher/modemmanager_exporter";
description = "Prometheus exporter for ModemManager and its devices";
mainProgram = "modemmanager_exporter";
license = licenses.mit;
maintainers = with maintainers; [ mdlayher ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "mongodb_exporter";
version = "0.47.1";
src = fetchFromGitHub {
owner = "percona";
repo = "mongodb_exporter";
rev = "v${version}";
hash = "sha256-UYV72Q+dDWiS4/sg4sVi68ZA67iSe7J5H/Iq4i7tNgY=";
};
vendorHash = "sha256-CE2gSvMEXeOuevFrD3b6bhlFrfQ6Y0Qa+HIhcTp9oiQ=";
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.commit=${src.rev}"
"-X main.Branch=unknown"
"-X main.buildDate=unknown"
];
subPackages = [ "." ];
# those check depends on docker;
# nixpkgs doesn't have mongodb application available;
doCheck = false;
meta = with lib; {
description = "Prometheus exporter for MongoDB including sharding, replication and storage engines";
homepage = "https://github.com/percona/mongodb_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ undefined-moe ];
mainProgram = "mongodb_exporter";
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
buildGoModule,
fetchFromGitHub,
gitUpdater,
testers,
prometheus-nats-exporter,
}:
buildGoModule rec {
pname = "prometheus-nats-exporter";
version = "0.15.0";
src = fetchFromGitHub {
owner = "nats-io";
repo = pname;
rev = "v${version}";
sha256 = "sha256-siucc55qi1SS2R07xgxh25CWYjxncUqvzxo0XoIPyOo=";
};
vendorHash = "sha256-vRUPLKxwVTt3t8UpsSH4yMCIShpYhYI6j7AEmlyOADs=";
preCheck = ''
# Fix `insecure algorithm SHA1-RSA` problem
export GODEBUG=x509sha1=1;
'';
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
prometheus-nats-exporter-version = testers.testVersion {
package = prometheus-nats-exporter;
};
};
};
meta = with lib; {
description = "Exporter for NATS metrics";
homepage = "https://github.com/nats-io/prometheus-nats-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ bbigras ];
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
fetchFromGitHub,
buildGoModule,
nixosTests,
}:
buildGoModule rec {
pname = "prometheus-nextcloud-exporter";
version = "0.8.0";
src = fetchFromGitHub {
owner = "xperimental";
repo = "nextcloud-exporter";
rev = "v${version}";
sha256 = "sha256-lK5a63ZokFlm5S3k1a0MGBm+vAAqQV/5ERjJ0zZ4Yno=";
};
vendorHash = "sha256-9+Vv2GodEocDppWvTj4W3/tBqSJJZ9LkyTl5evm/45Y=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) nextcloud; };
meta = with lib; {
description = "Prometheus exporter for Nextcloud servers";
homepage = "https://github.com/xperimental/nextcloud-exporter";
license = licenses.mit;
maintainers = [ ];
mainProgram = "nextcloud-exporter";
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "nginx_exporter";
version = "1.5.0";
src = fetchFromGitHub {
owner = "nginxinc";
repo = "nginx-prometheus-exporter";
rev = "v${version}";
sha256 = "sha256-N1+BfuhB0dZ8S88+onVwSiFABnFJjNlIVF/5puCuugs=";
};
vendorHash = "sha256-sT/hwqKJpQet1NgLuKvJDtB+y6mHCfHABMZ4PJNj490=";
ldflags =
let
t = "github.com/prometheus/common/version";
in
[
"-s"
"-w"
"-X ${t}.Version=${version}"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) nginx; };
meta = with lib; {
description = "NGINX Prometheus Exporter for NGINX and NGINX Plus";
mainProgram = "nginx-prometheus-exporter";
homepage = "https://github.com/nginxinc/nginx-prometheus-exporter";
license = licenses.asl20;
maintainers = with maintainers; [
benley
fpletz
globin
];
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "nginxlog_exporter";
version = "1.11.0";
src = fetchFromGitHub {
owner = "martin-helmich";
repo = "prometheus-nginxlog-exporter";
rev = "v${version}";
sha256 = "sha256-UkXrVHHHZ9mEgsMUcHu+wI6NZFw4h3X4atDBjpBcz8E=";
};
vendorHash = "sha256-RzqfmP1d3zqageiGSr+CxSJQxAXmOKRCwj/7KO2f3EE=";
subPackages = [ "." ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) nginxlog; };
meta = with lib; {
description = "Export metrics from Nginx access log files to Prometheus";
mainProgram = "prometheus-nginxlog-exporter";
homepage = "https://github.com/martin-helmich/prometheus-nginxlog-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ mmahut ];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "nut-exporter";
version = "3.2.1";
src = fetchFromGitHub {
owner = "DRuggeri";
repo = "nut_exporter";
rev = "v${version}";
sha256 = "sha256-TqBwvOuhcnQbJBfzJ8nc3EYVo8fyCPwne+vEYZeX9/I=";
};
vendorHash = "sha256-cMZ4GSal03LIZi7ESr/sQx8zLHNepOTZGEEsdvsNhec=";
meta = with lib; {
description = "Prometheus exporter for Network UPS Tools";
mainProgram = "nut_exporter";
homepage = "https://github.com/DRuggeri/nut_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ jhh ];
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "pgbouncer-exporter";
version = "0.11.0";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = "pgbouncer_exporter";
rev = "v${version}";
hash = "sha256-YvkD6X2aSXeOW7O5RqAVM1Fo6KE8OCh0+QzgoW8QAVg=";
};
vendorHash = "sha256-IBIJWA/arARPV0ErAQdGJXbPAaryCN22mHwKL08M8QA=";
meta = with lib; {
description = "Prometheus exporter for PgBouncer";
mainProgram = "pgbouncer_exporter";
homepage = "https://github.com/prometheus-community/pgbouncer_exporter";
license = licenses.mit;
maintainers = with maintainers; [ _1000101 ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,63 @@
{
lib,
buildGoModule,
fetchFromGitHub,
makeWrapper,
installShellFiles,
getent,
nix-update-script,
testers,
prometheus-php-fpm-exporter,
}:
buildGoModule rec {
pname = "php-fpm_exporter";
version = "2.2.0";
src = fetchFromGitHub {
owner = "hipages";
repo = pname;
rev = "v${version}";
hash = "sha256-ggrFnyEdGBoZVh4dHMw+7RUm8nJ1hJXo/fownO3wvzE=";
};
vendorHash = "sha256-OK36tHkBtosdfEWFPYMtlbzCkh5cF35NBWYyJrb9fwg=";
nativeBuildInputs = [
makeWrapper
installShellFiles
];
ldflags = [
"-X main.version=${version}"
];
preFixup = ''
wrapProgram "$out/bin/php-fpm_exporter" \
--prefix PATH ":" "${lib.makeBinPath [ getent ]}"
'';
postInstall = ''
installShellCompletion --cmd php-fpm_exporter \
--bash <($out/bin/php-fpm_exporter completion bash) \
--fish <($out/bin/php-fpm_exporter completion fish) \
--zsh <($out/bin/php-fpm_exporter completion zsh)
'';
passthru = {
updateScript = nix-update-script { };
tests = testers.testVersion {
inherit version;
package = prometheus-php-fpm-exporter;
command = "php-fpm_exporter version";
};
};
meta = with lib; {
homepage = "https://github.com/hipages/php-fpm_exporter";
description = "Prometheus exporter for PHP-FPM";
license = licenses.asl20;
maintainers = with maintainers; [ gaelreyrol ];
mainProgram = "php-fpm_exporter";
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "pihole-exporter";
version = "1.2.0";
src = fetchFromGitHub {
owner = "eko";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ge4+sWQkJ2Zc7Y7+IYAq6OK6pYkaE3jjFo1rhTaDMu4=";
};
vendorHash = "sha256-4qbfXRXEViR/2fCmanlU88zvbJb5oppHWC7rVQaneLc=";
meta = with lib; {
description = "Prometheus exporter for PI-Hole's Raspberry PI ad blocker";
mainProgram = "pihole-exporter";
homepage = "https://github.com/eko/pihole-exporter";
license = licenses.mit;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "ping-exporter";
version = "1.1.4";
src = fetchFromGitHub {
owner = "czerwonk";
repo = "ping_exporter";
rev = version;
hash = "sha256-H+HcwDMnRgvEnbaI/tcS457Ir2Xtq30g44EYo4UPCE0=";
};
vendorHash = "sha256-bEJstamu0+EfHL2cduWb/iDeYCp8tzGCS2Lvc7Onp48=";
meta = with lib; {
description = "Prometheus exporter for ICMP echo requests";
mainProgram = "ping_exporter";
homepage = "https://github.com/czerwonk/ping_exporter";
license = licenses.mit;
maintainers = with maintainers; [ nudelsalat ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
buildGoModule,
fetchFromGitHub,
makeWrapper,
nixosTests,
systemd,
withSystemdSupport ? true,
}:
buildGoModule rec {
pname = "postfix_exporter";
version = "0.15.0";
src = fetchFromGitHub {
owner = "Hsn723";
repo = "postfix_exporter";
tag = "v${version}";
sha256 = "sha256-0HgvkKdgfKcX74dJLOxSnp1xJuaOazusgDrCdhX/Lg4=";
};
vendorHash = "sha256-HsXVZ6fmaGU93CpA+t/VpIsEigkh09Uw8h7eSeaThk4=";
ldflags = [
"-s"
"-w"
];
nativeBuildInputs = lib.optionals withSystemdSupport [ makeWrapper ];
buildInputs = lib.optionals withSystemdSupport [ systemd ];
tags = lib.optionals (!withSystemdSupport) "nosystemd";
postInstall = lib.optionals withSystemdSupport ''
wrapProgram $out/bin/postfix_exporter \
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) postfix; };
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus exporter for Postfix";
mainProgram = "postfix_exporter";
license = licenses.asl20;
maintainers = with maintainers; [
globin
];
};
}

View File

@@ -0,0 +1,50 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "postgres_exporter";
version = "0.18.1";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = "postgres_exporter";
rev = "v${version}";
sha256 = "sha256-yiWcJVpa5yGNk1ahbb+0uVzpFaXqBL2qgS0aH+bi4rU=";
};
vendorHash = "sha256-/9a3lB9V25OppkeLsIr02LZPLAQrQYZ74RJIDHiG6w8=";
ldflags =
let
t = "github.com/prometheus/common/version";
in
[
"-s"
"-w"
"-X ${t}.Version=${version}"
"-X ${t}.Revision=unknown"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
];
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) postgres; };
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus exporter for PostgreSQL";
mainProgram = "postgres_exporter";
license = licenses.asl20;
maintainers = with maintainers; [
fpletz
globin
ma27
];
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "process-exporter";
version = "0.8.7";
src = fetchFromGitHub {
owner = "ncabatoff";
repo = pname;
rev = "v${version}";
sha256 = "sha256-dxXBhrZdYM+mH73K/cdaSmfzbzZaPJYCTzcfXGYMlyY=";
};
vendorHash = "sha256-3uhwP8WgZ+zmP6Ex1xcQIj/qGoAot/YC3Vu+leMqEQ4=";
postPatch = ''
substituteInPlace proc/read_test.go --replace /bin/cat cat
'';
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) process; };
meta = with lib; {
description = "Prometheus exporter that mines /proc to report on selected processes";
homepage = "https://github.com/ncabatoff/process-exporter";
license = licenses.mit;
maintainers = with maintainers; [ _1000101 ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "prom2json";
version = "1.4.2";
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus";
repo = "prom2json";
sha256 = "sha256-3A26xMXJv2MMpFoc0zKZdSLg9WCueIsKdRdyM2NsUJw=";
};
vendorHash = "sha256-2XZYc6byupFTR2HCAVSL3wLYWwuzkkhqegzZRTakcgI=";
meta = with lib; {
description = "Tool to scrape a Prometheus client and dump the result as JSON";
mainProgram = "prom2json";
homepage = "https://github.com/prometheus/prom2json";
license = licenses.asl20;
maintainers = with maintainers; [ benley ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
python3,
fetchPypi,
nixosTests,
}:
python3.pkgs.buildPythonApplication rec {
pname = "prometheus_pve_exporter";
version = "3.5.5";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-QFo/gnRF6+mk/xs6vJCxbR64LI3JwrLVwXib6tcEN8g=";
};
propagatedBuildInputs = with python3.pkgs; [
prometheus-client
proxmoxer
pyyaml
requests
werkzeug
gunicorn
];
doCheck = false;
pythonImportsCheck = [ "pve_exporter" ];
passthru.tests = {
inherit (nixosTests.prometheus-exporters) pve;
};
meta = with lib; {
description = "Exposes information gathered from Proxmox VE cluster for use by the Prometheus monitoring system";
mainProgram = "pve_exporter";
homepage = "https://github.com/prometheus-pve/prometheus-pve-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ nukaduka ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "rabbitmq_exporter";
version = "1.0.0";
src = fetchFromGitHub {
owner = "kbudde";
repo = "rabbitmq_exporter";
tag = "v${version}";
hash = "sha256-A6pBhfH+BK+0QQUl7H1y7TLd5hSaSyGCvR4Br/3DaN4=";
};
vendorHash = "sha256-O/3y3FwFp4gUFN8OmVeoHU6yJZYng7rU9VeDcCwWayI=";
ldflags = [
"-s"
"-w"
];
checkFlags = [
# Disable flaky tests on Darwin
"-skip=TestWholeApp|TestExporter"
];
meta = {
description = "Prometheus exporter for RabbitMQ";
mainProgram = "rabbitmq_exporter";
homepage = "https://github.com/kbudde/rabbitmq_exporter";
license = lib.licenses.mit;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,69 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
# Test dependencies
redisTestHook,
}:
buildGoModule rec {
pname = "redis_exporter";
version = "1.78.0";
src = fetchFromGitHub {
owner = "oliver006";
repo = "redis_exporter";
rev = "v${version}";
sha256 = "sha256-Nj2SvnKk04kTVm4O1v809WslW/egKVsZO0b9zTKIoWQ=";
};
vendorHash = "sha256-7/7O61tOEUsRVkFVkmOiHqgxmFDmwaw8s97aOQr89Mg=";
ldflags = [
"-X main.BuildVersion=${version}"
"-X main.BuildCommitSha=unknown"
"-X main.BuildDate=unknown"
];
nativeCheckInputs = [
redisTestHook
];
preCheck = ''
export TEST_REDIS_URI="redis://localhost:6379"
'';
__darwinAllowLocalNetworking = true;
checkFlags =
let
skippedTests = [
"TestLatencySpike" # timing-sensitive
# The following tests require ad-hoc generated TLS certificates in the source dir.
# This is not possible in the read-only Nix store.
"TestCreateClientTLSConfig"
"TestValkeyTLSScheme"
"TestCreateServerTLSConfig"
"TestGetServerCertificateFunc"
"TestGetConfigForClientFunc"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) redis; };
meta = with lib; {
description = "Prometheus exporter for Redis metrics";
mainProgram = "redis_exporter";
homepage = "https://github.com/oliver006/redis_exporter";
license = licenses.mit;
maintainers = with maintainers; [
eskytthe
srhb
ma27
];
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
buildGoModule,
fetchFromGitHub,
bash,
nixosTests,
}:
buildGoModule rec {
pname = "rtl_433-exporter";
version = "0.1";
src = fetchFromGitHub {
owner = "mhansen";
repo = "rtl_433_prometheus";
rev = "v${version}";
hash = "sha256-ggtGi1gnpTLGvZnfAW9vyYyU7ELbTRNhXyCMotx+KKU=";
};
postPatch = "substituteInPlace rtl_433_prometheus.go --replace /bin/bash ${bash}/bin/bash";
vendorHash = "sha256-BsNB0OTwBUu9kK+lSN7EF8ZQH3kFx8P9h4QgcfCvtg4=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) rtl_433; };
meta = with lib; {
description = "Prometheus time-series DB exporter for rtl_433 433MHz radio packet decoder";
mainProgram = "rtl_433_prometheus";
homepage = "https://github.com/mhansen/rtl_433_prometheus";
license = licenses.mit;
maintainers = with maintainers; [ zopieux ];
};
}

View File

@@ -0,0 +1,50 @@
{
lib,
fetchFromGitHub,
python3Packages,
nixosTests,
}:
python3Packages.buildPythonApplication rec {
pname = "sabnzbd_exporter";
version = "0.1.78";
format = "other";
src = fetchFromGitHub {
owner = "msroest";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-BLqG2I7D/bqRj6+/LUKOimmTRTH/kRdukkGdOJT3+PA=";
};
propagatedBuildInputs = with python3Packages; [
prometheus-client
requests
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp sabnzbd_exporter.py $out/bin/
mkdir -p $out/share/${pname}
cp examples/* $out/share/${pname}/
runHook postInstall
'';
passthru.tests = {
inherit (nixosTests.prometheus-exporters) sabnzbd;
};
meta = with lib; {
description = "Prometheus exporter for sabnzbd";
homepage = "https://github.com/msroest/sabnzbd_exporter";
license = licenses.mit;
maintainers = with maintainers; [ fugi ];
platforms = platforms.all;
mainProgram = "sabnzbd_exporter.py";
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "sachet";
version = "0.3.2";
src = fetchFromGitHub {
owner = "messagebird";
repo = pname;
rev = version;
hash = "sha256-zcFViE1/B+wrkxZ3YIyfy2IBbxLvXOf8iK/6eqZb1ZQ=";
};
vendorHash = null;
meta = with lib; {
description = "SMS alerting tool for Prometheus's Alertmanager";
mainProgram = "sachet";
homepage = "https://github.com/messagebird/sachet";
license = licenses.bsd2;
maintainers = with maintainers; [ govanify ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
subPackages = [ "cmd" ];
postInstall = ''
mv $out/bin/cmd $out/bin/script_exporter
'';
pname = "script_exporter";
version = "3.0.1";
src = fetchFromGitHub {
owner = "ricoberger";
repo = pname;
rev = "v${version}";
hash = "sha256-09WpxXPNk2Pza9RrD3OLru4aY0LR98KgsHK7It/qRgs=";
};
postPatch = ''
# Patch out failing test assertion in handler_test.go
# Insert t.Skip at the start of TestHandler to skip it cleanly
sed -i '/func TestHandler/a\\ t.Skip("skipped in Nix build")' prober/handler_test.go
'';
vendorHash = "sha256-Rs7P7uVvfhWteiR10LeG4fWZqbNqDf3QQotgNvTMTX4=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) script; };
meta = with lib; {
description = "Shell script prometheus exporter";
mainProgram = "script_exporter";
homepage = "https://github.com/ricoberger/script_exporter";
license = licenses.mit;
maintainers = with maintainers; [ Flakebi ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "shelly_exporter";
version = "1.0.0";
src = fetchFromGitHub {
owner = "aexel90";
repo = pname;
rev = "v${version}";
sha256 = "sha256-L0TuBDq5eEahQvzqd1WuvmXuQbbblCM+Nvj15IybnVo=";
};
vendorHash = "sha256-BCrge2xLT4b4wpYA+zcsH64a/nfV8+HeZF7L49p2gEw=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) shelly; };
meta = with lib; {
description = "Shelly humidity sensor exporter for prometheus";
mainProgram = "shelly_exporter";
homepage = "https://github.com/aexel90/shelly_exporter";
license = licenses.asl20;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "smokeping_prober";
version = "0.10.0";
ldflags =
let
setVars = rec {
Version = version;
Revision = "722200c4adbd6d1e5d847dfbbd9dec07aa4ca38d";
Branch = Revision;
BuildUser = "nix";
};
varFlags = lib.concatStringsSep " " (
lib.mapAttrsToList (name: value: "-X github.com/prometheus/common/version.${name}=${value}") setVars
);
in
[
"${varFlags}"
"-s"
"-w"
];
src = fetchFromGitHub {
owner = "SuperQ";
repo = "smokeping_prober";
rev = "v${version}";
sha256 = "sha256-dsdwXBTAPkMjaAWBjkNiJEaKi5cIcr1qctVDTuzmjAo=";
};
vendorHash = "sha256-anc4YtkfkPt8mXRZcVD8kQt2X2O3SCpRWPIqV4yz92E=";
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) smokeping; };
meta = with lib; {
description = "Prometheus exporter for sending continual ICMP/UDP pings";
mainProgram = "smokeping_prober";
homepage = "https://github.com/SuperQ/smokeping_prober";
license = licenses.asl20;
maintainers = with maintainers; [ lukegb ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
buildGoModule,
fetchFromGitHub,
net-snmp,
nixosTests,
}:
buildGoModule rec {
pname = "snmp_exporter";
version = "0.29.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "snmp_exporter";
rev = "v${version}";
sha256 = "sha256-eM3R4wNsBeGscaTzqdrj9ceiKFjRF3F78SWDamNMEYM=";
};
vendorHash = "sha256-C5iY3hBqepxLkGwPDVmnDf/ugF4h5y8scEomU9mkMEM=";
buildInputs = [ net-snmp ];
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) snmp; };
meta = with lib; {
description = "SNMP Exporter for Prometheus";
homepage = "https://github.com/prometheus/snmp_exporter";
license = licenses.asl20;
maintainers = with maintainers; [
oida
Frostman
];
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
buildGoModule,
fetchFromGitHub,
go,
prometheus-sql-exporter,
testers,
}:
buildGoModule rec {
pname = "sql_exporter";
version = "0.8";
src = fetchFromGitHub {
owner = "justwatchcom";
repo = pname;
rev = "v${version}";
sha256 = "sha256-6aJ1vBhRgHmWFoEB1pd+mCqeb1y7G91HshcZ7ehf35w=";
};
vendorHash = null;
ldflags =
let
t = "github.com/prometheus/common/version";
in
[
"-X ${t}.Version=${version}"
"-X ${t}.Revision=${src.rev}"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
"-X ${t}.GoVersion=${lib.getVersion go}"
];
passthru.tests.version = testers.testVersion {
package = prometheus-sql-exporter;
command = "sql_exporter -version";
};
meta = with lib; {
description = "Flexible SQL exporter for Prometheus";
mainProgram = "sql_exporter";
homepage = "https://github.com/justwatchcom/sql_exporter";
license = licenses.mit;
maintainers = with maintainers; [ justinas ];
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "statsd_exporter";
version = "0.28.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "statsd_exporter";
rev = "v${version}";
hash = "sha256-h58yD+jmvUCvYsJqNcBSR1f+5YgDyMbLDd3I0HW9/kA=";
};
ldflags =
let
t = "github.com/prometheus/common/version";
in
[
"-s"
"-w"
"-X ${t}.Version=${version}"
"-X ${t}.Revision=unknown"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
];
vendorHash = "sha256-QKDvoctvvdijQ+ZlClqTyJZfDzqAIikAwOQds9+NQIc=";
meta = with lib; {
description = "Receives StatsD-style metrics and exports them to Prometheus";
mainProgram = "statsd_exporter";
homepage = "https://github.com/prometheus/statsd_exporter";
changelog = "https://github.com/prometheus/statsd_exporter/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = with maintainers; [
benley
ivan
];
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule rec {
pname = "systemd_exporter";
version = "0.7.0";
vendorHash = "sha256-4hsQ1417jLNOAqGkfCkzrmEtYR4YLLW2j0CiJtPg6GI=";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = pname;
rev = "v${version}";
sha256 = "sha256-wWXtAyQ48fsh/9BBo2tHXf4QS3Pbsmj6rha28TdBRWI=";
};
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=unknown"
"-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"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) systemd; };
meta = with lib; {
description = "Exporter for systemd unit metrics";
mainProgram = "systemd_exporter";
homepage = "https://github.com/prometheus-community/systemd_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ chkno ];
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
let
version = "0.4.6";
in
buildGoModule {
pname = "unbound_exporter";
inherit version;
src = fetchFromGitHub {
owner = "letsencrypt";
repo = "unbound_exporter";
rev = "refs/tags/v${version}";
hash = "sha256-p2VSIQXTnNGgqUSvWQ4J3SbrnWGBO21ps4VCWOjioLM=";
};
vendorHash = "sha256-q3JqAGeEU5WZWTzdFE9hR2dAnsFjMM44JiYdodZrnhs=";
passthru.tests = {
inherit (nixosTests.prometheus-exporters) unbound;
};
meta = with lib; {
changelog = "https://github.com/letsencrypt/unbound_exporter/releases/tag/v${version}";
description = "Prometheus exporter for Unbound DNS resolver";
mainProgram = "unbound_exporter";
homepage = "https://github.com/letsencrypt/unbound_exporter/tree/main";
license = licenses.asl20;
maintainers = with maintainers; [ hexa ];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "v2ray-exporter";
version = "0.6.0";
src = fetchFromGitHub {
owner = "wi1dcard";
repo = "v2ray-exporter";
rev = "v${version}";
sha256 = "12mzng3cw24fyyh8zjfi26gh853k5blzg3zbxcccnv5lryh2r0yi";
};
vendorHash = "sha256-+jrD+QatTrMaAdbxy5mpCm8lF37XDIy1GFyEiUibA2k=";
meta = with lib; {
description = "Prometheus exporter for V2Ray daemon";
mainProgram = "v2ray-exporter";
homepage = "https://github.com/wi1dcard/v2ray-exporter";
license = licenses.mit;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,39 @@
{
lib,
buildGoModule,
fetchFromGitHub,
makeWrapper,
varnish,
nixosTests,
}:
buildGoModule rec {
pname = "prometheus_varnish_exporter";
version = "1.6.1";
src = fetchFromGitHub {
owner = "jonnenauha";
repo = "prometheus_varnish_exporter";
rev = version;
hash = "sha256-1sUzKLNkLP/eX0wYSestMAJpjAmX1iimjYoFYb6Mgpc=";
};
vendorHash = "sha256-P2fR0U2O0Y4Mci9jkAMb05WR+PrpuQ59vbLMG5b9KQI=";
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/prometheus_varnish_exporter \
--prefix PATH : "${varnish}/bin"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) varnish; };
meta = {
homepage = "https://github.com/jonnenauha/prometheus_varnish_exporter";
description = "Varnish exporter for Prometheus";
mainProgram = "prometheus_varnish_exporter";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ MostAwesomeDude ];
};
}

View File

@@ -0,0 +1,44 @@
{
stdenv,
rustPlatform,
fetchFromGitHub,
lib,
libiconv,
nixosTests,
}:
rustPlatform.buildRustPackage rec {
pname = "wireguard-exporter";
version = "3.6.6";
src = fetchFromGitHub {
owner = "MindFlavor";
repo = "prometheus_wireguard_exporter";
rev = version;
sha256 = "sha256-2e31ZuGJvpvu7L2Lb+n6bZWpC1JhETzEzSiNaxxsAtA=";
};
cargoHash = "sha256-PVjeCKGHiHo+OtjIxMZBBJ19Z3807R34Oyu/HYZO90U=";
postPatch = ''
# drop hardcoded linker names, fixing static build
rm .cargo/config.toml
'';
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) wireguard; };
meta = with lib; {
description = "Prometheus exporter for WireGuard, written in Rust";
homepage = "https://github.com/MindFlavor/prometheus_wireguard_exporter";
license = licenses.mit;
maintainers = with maintainers; [
ma27
globin
];
mainProgram = "prometheus_wireguard_exporter";
};
}

View File

@@ -0,0 +1,63 @@
{
lib,
fetchFromGitHub,
python3Packages,
prometheus-alertmanager,
runCommand,
prometheus-xmpp-alerts,
}:
python3Packages.buildPythonApplication rec {
pname = "prometheus-xmpp-alerts";
version = "0.6.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "jelmer";
repo = pname;
rev = "v${version}";
sha256 = "sha256-kXcadJnPPhMKF/1CHMLdGCqWouAKDBFTdvPpn80yK4A=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "bs4" "beautifulsoup4"
'';
propagatedBuildInputs = [
prometheus-alertmanager
]
++ (with python3Packages; [
aiohttp
aiohttp-openmetrics
beautifulsoup4
jinja2
slixmpp
prometheus-client
pyyaml
]);
nativeCheckInputs = with python3Packages; [
setuptools
unittestCheckHook
pytz
];
pythonImportsCheck = [ "prometheus_xmpp" ];
passthru.tests = {
binaryWorks = runCommand "${pname}-binary-test" { } ''
# Running with --help to avoid it erroring due to a missing config file
${prometheus-xmpp-alerts}/bin/prometheus-xmpp-alerts --help | tee $out
grep "usage: prometheus-xmpp-alerts" $out
'';
};
meta = {
description = "XMPP Web hook for Prometheus";
mainProgram = "prometheus-xmpp-alerts";
homepage = "https://github.com/jelmer/prometheus-xmpp-alerts";
maintainers = with lib.maintainers; [ fpletz ];
license = with lib.licenses; [ asl20 ];
};
}

View File

@@ -0,0 +1,41 @@
{
buildGoModule,
lib,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "zfs_exporter";
version = "2.3.10";
src = fetchFromGitHub {
owner = "pdf";
repo = pname;
rev = "v" + version;
hash = "sha256-8of1FdfofkmlTMSJKbpBxI5KNEu2y1Epkl2L6nNAJ/k=";
};
vendorHash = "sha256-wXPFR1B86oq/RieyYP1KTrpaUu3xOQnX2ismYt9N2Aw=";
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=unknown"
"-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"
];
postInstall = ''
install -Dm444 -t $out/share/doc/${pname} *.md
'';
meta = with lib; {
description = "ZFS Exporter for the Prometheus monitoring system";
mainProgram = "zfs_exporter";
homepage = "https://github.com/pdf/zfs_exporter";
license = licenses.mit;
maintainers = with maintainers; [ peterhoeg ];
};
}