uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
27
pkgs/servers/monitoring/alerta/client.nix
Normal file
27
pkgs/servers/monitoring/alerta/client.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib
|
||||
, python3
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "alerta";
|
||||
version = "8.5.1";
|
||||
|
||||
src = python3.pkgs.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-O13Ic2iHjNF/llp6vdaAiiWExcTBPsz46GAWY3oGDY8=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
six click requests requests-hawk pytz tabulate
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
disabled = python3.pythonOlder "3.6";
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://alerta.io";
|
||||
description = "Alerta Monitoring System command-line interface";
|
||||
license = licenses.asl20;
|
||||
};
|
||||
}
|
||||
46
pkgs/servers/monitoring/alerta/default.nix
Normal file
46
pkgs/servers/monitoring/alerta/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ lib
|
||||
, python3
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "alerta-server";
|
||||
version = "8.7.0";
|
||||
|
||||
src = python3.pkgs.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-EM3owmj+6gFjU0ARaQP3FLYXliGaGCRSaLgkiPwhGdU=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
bcrypt
|
||||
blinker
|
||||
flask
|
||||
flask-compress
|
||||
flask-cors
|
||||
mohawk
|
||||
psycopg2
|
||||
pyjwt
|
||||
pymongo
|
||||
pyparsing
|
||||
python-dateutil
|
||||
pytz
|
||||
pyyaml
|
||||
requests
|
||||
requests-hawk
|
||||
sentry-sdk
|
||||
];
|
||||
|
||||
# We can't run the tests from Nix, because they rely on the presence of a working MongoDB server
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [
|
||||
"alerta"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://alerta.io";
|
||||
description = "Alerta Monitoring System server";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
}
|
||||
34
pkgs/servers/monitoring/alertmanager-bot/default.nix
Normal file
34
pkgs/servers/monitoring/alertmanager-bot/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "alertmanager-bot";
|
||||
version = "0.4.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "metalmatze";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1hjfkksqb675gabzjc221b33h2m4s6qsanmkm382d3fyzqj71dh9";
|
||||
};
|
||||
|
||||
vendorSha256 = "1v0fgin8dn81b559zz4lqmrl7hikr46g4gb18sci4riql5qs1isj";
|
||||
|
||||
postPatch = ''
|
||||
sed "s;/templates/default.tmpl;$out/share&;" -i cmd/alertmanager-bot/main.go
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s" "-w" "-X main.Version=v${version}" "-X main.Revision=${src.rev}"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
install -Dm644 -t $out/share/templates $src/default.tmpl
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Bot for Prometheus' Alertmanager";
|
||||
homepage = "https://github.com/metalmatze/alertmanager-bot";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ mmahut ];
|
||||
};
|
||||
}
|
||||
29
pkgs/servers/monitoring/alertmanager-irc-relay/default.nix
Normal file
29
pkgs/servers/monitoring/alertmanager-irc-relay/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "alertmanager-irc-relay";
|
||||
version = "0.4.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "google";
|
||||
repo = "alertmanager-irc-relay";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-ACOXrIeNDUFUwr50frW/miuW1eq29UvCYac5HCdXfx8=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-VLG15IXS/fXFMTCJKEqGW6qZ9aOLPhazidVsOywG+w4=";
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Alertmanager IRC Relay is a bot relaying Prometheus alerts to IRC";
|
||||
longDescription = ''
|
||||
Alertmanager IRC Relay is a bot relaying Prometheus alerts to IRC.
|
||||
Alerts are received from Prometheus using Webhooks and are relayed to an
|
||||
IRC channel
|
||||
'';
|
||||
homepage = "https://github.com/google/alertmanager-irc-relay";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ ymatsiuk ];
|
||||
};
|
||||
}
|
||||
24
pkgs/servers/monitoring/bosun/default.nix
Normal file
24
pkgs/servers/monitoring/bosun/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, fetchFromGitHub, buildGoPackage }:
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "bosun";
|
||||
version = "0.8.0-preview";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bosun-monitor";
|
||||
repo = "bosun";
|
||||
rev = version;
|
||||
sha256 = "172mm006jarc2zm2yq7970k2a9akmyzvsrr8aqym4wk5v9x8kk0r";
|
||||
};
|
||||
|
||||
subPackages = [ "cmd/bosun" "cmd/scollector" ];
|
||||
goPackagePath = "bosun.org";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Time Series Alerting Framework";
|
||||
license = licenses.mit;
|
||||
homepage = "https://bosun.org";
|
||||
maintainers = with maintainers; [ offline ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
42
pkgs/servers/monitoring/buildkite-agent-metrics/default.nix
Normal file
42
pkgs/servers/monitoring/buildkite-agent-metrics/default.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "buildkite-agent-metrics";
|
||||
version = "5.2.1";
|
||||
|
||||
outputs = [ "out" "lambda" ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "buildkite";
|
||||
repo = "buildkite-agent-metrics";
|
||||
rev = "v${version}";
|
||||
sha256 = "XZYVCSJ/DIwoLrz37aQ3yW3RUhOhorY8L1AsAWxywcg=";
|
||||
};
|
||||
|
||||
vendorSha256 = "UIkU3i45IEXWHdiakTj7f4W9kR49k4A93msfkqeXmQQ=";
|
||||
|
||||
patches = [
|
||||
# Necessary to support passing the agent token in an env var, rather than on
|
||||
# the command line. Should be removed upon the next release.
|
||||
(fetchpatch {
|
||||
name = "BUILDKITE_AGENT_TOKEN-env-var.patch";
|
||||
url = "https://github.com/buildkite/buildkite-agent-metrics/commit/6c40b478b95f0e05fc12b87158222a9ff68169e0.patch";
|
||||
sha256 = "Y4m9qGyPIROSqOY6G6xRQfFENEG4bFF3q5dZcHI4XiY=";
|
||||
})
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $lambda/bin
|
||||
mv $out/bin/lambda $lambda/bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A command-line tool (and Lambda) for collecting Buildkite agent metrics";
|
||||
homepage = "https://github.com/buildkite/buildkite-agent-metrics";
|
||||
license = licenses.mit;
|
||||
maintainers = teams.determinatesystems.members;
|
||||
};
|
||||
}
|
||||
36
pkgs/servers/monitoring/cadvisor/default.nix
Normal file
36
pkgs/servers/monitoring/cadvisor/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "cadvisor";
|
||||
version = "0.40.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "google";
|
||||
repo = "cadvisor";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-8HOaKjdATVZpyx4yLf7xefz+jiOEqmkWiZnA3DOyT50=";
|
||||
};
|
||||
|
||||
modRoot = "./cmd";
|
||||
|
||||
vendorSha256 = "sha256-+nrXD0hQ3zBwTTq9xoBqO3ho4s4tf8uZQz2wL1nYi/k=";
|
||||
|
||||
ldflags = [ "-s" "-w" "-X github.com/google/cadvisor/version.Version=${version}" ];
|
||||
|
||||
postInstall = ''
|
||||
mv $out/bin/{cmd,cadvisor}
|
||||
rm $out/bin/example
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
rm internal/container/mesos/handler_test.go
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Analyzes resource usage and performance characteristics of running docker containers";
|
||||
homepage = "https://github.com/google/cadvisor";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ offline ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
27
pkgs/servers/monitoring/consul-alerts/default.nix
Normal file
27
pkgs/servers/monitoring/consul-alerts/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib, buildGoPackage, fetchFromGitHub }:
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "consul-alerts";
|
||||
version = "0.6.0";
|
||||
rev = "v${version}";
|
||||
|
||||
goPackagePath = "github.com/AcalephStorage/consul-alerts";
|
||||
|
||||
goDeps = ./deps.nix;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "AcalephStorage";
|
||||
repo = "consul-alerts";
|
||||
sha256 = "0836zicv76sd6ljhbbii1mrzh65pch10w3gfa128iynaviksbgn5";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "An extendable open source continuous integration server";
|
||||
homepage = "https://github.com/AcalephStorage/consul-alerts";
|
||||
# As per README
|
||||
platforms = platforms.linux ++ platforms.freebsd ++ platforms.darwin;
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ nh2 ];
|
||||
};
|
||||
}
|
||||
34
pkgs/servers/monitoring/consul-alerts/deps.nix
generated
Normal file
34
pkgs/servers/monitoring/consul-alerts/deps.nix
generated
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
let
|
||||
mkAwsPackage = name: {
|
||||
goPackagePath = "github.com/aws/aws-sdk-go/${name}";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/aws/aws-sdk-go";
|
||||
rev = "v1.14.13";
|
||||
sha256 = "0014b6kl3rbjhjbk7jz116wdgdls54b1bwz454pkn1snlvkj3qil";
|
||||
};
|
||||
};
|
||||
in
|
||||
[
|
||||
(mkAwsPackage "")
|
||||
(mkAwsPackage "aws/session")
|
||||
(mkAwsPackage "aws/sns")
|
||||
(mkAwsPackage "service/sns")
|
||||
{
|
||||
goPackagePath = "github.com/imdario/mergo";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/imdario/mergo";
|
||||
rev = "v0.3.5";
|
||||
sha256 = "1mvgn89vp39gcpvhiq4n7nw5ipj7fk6h03jgc6fjwgvwvss213pb";
|
||||
};
|
||||
}{
|
||||
goPackagePath = "github.com/mitchellh/hashstructure";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/mitchellh/hashstructure";
|
||||
rev = "2bca23e0e452137f789efbc8610126fd8b94f73b"; # has no releases as of writing
|
||||
sha256 = "0vpacsls26474wya360fjhzi6l4y8s8s251c4szvqxh17n5f5gk1";
|
||||
};
|
||||
}
|
||||
]
|
||||
38
pkgs/servers/monitoring/do-agent/default.nix
Normal file
38
pkgs/servers/monitoring/do-agent/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "do-agent";
|
||||
version = "3.13.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "digitalocean";
|
||||
repo = "do-agent";
|
||||
rev = version;
|
||||
sha256 = "sha256-GJwNJRH7Ib4b3ZP0JHDMZD6h/AZvpRpIaZUDtnLFVoc=";
|
||||
};
|
||||
|
||||
ldflags = [
|
||||
"-X main.version=${version}"
|
||||
];
|
||||
|
||||
vendorSha256 = null;
|
||||
|
||||
doCheck = false;
|
||||
|
||||
postInstall = ''
|
||||
install -Dm444 -t $out/lib/systemd/system $src/packaging/etc/systemd/system/do-agent.service
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "DigitalOcean droplet system metrics agent";
|
||||
longDescription = ''
|
||||
do-agent is a program provided by DigitalOcean that collects system
|
||||
metrics from a DigitalOcean Droplet (on which the program runs) and sends
|
||||
them to DigitalOcean to provide resource usage graphs and alerting.
|
||||
'';
|
||||
homepage = "https://github.com/digitalocean/do-agent";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ yvt ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
84
pkgs/servers/monitoring/fusion-inventory/default.nix
Normal file
84
pkgs/servers/monitoring/fusion-inventory/default.nix
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{ lib, perlPackages, nix, dmidecode, pciutils, usbutils, iproute2, nettools
|
||||
, fetchFromGitHub, makeWrapper
|
||||
}:
|
||||
|
||||
perlPackages.buildPerlPackage rec {
|
||||
pname = "FusionInventory-Agent";
|
||||
version = "2.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fusioninventory";
|
||||
repo = "fusioninventory-agent";
|
||||
rev = version;
|
||||
sha256 = "1hbp5a9m03n6a80xc8z640zs71qhqk4ifafr6fp0vvzzvq097ip2";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
||||
patchShebangs bin
|
||||
|
||||
substituteInPlace "lib/FusionInventory/Agent/Tools/Linux.pm" \
|
||||
--replace /sbin/ip ${iproute2}/sbin/ip
|
||||
substituteInPlace "lib/FusionInventory/Agent/Task/Inventory/Linux/Networks.pm" \
|
||||
--replace /sbin/ip ${iproute2}/sbin/ip
|
||||
'';
|
||||
|
||||
buildTools = [];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = (with perlPackages; [
|
||||
CGI
|
||||
DataStructureUtil
|
||||
FileCopyRecursive
|
||||
HTTPProxy
|
||||
HTTPServerSimple
|
||||
HTTPServerSimpleAuthen
|
||||
IOCapture
|
||||
IOSocketSSL
|
||||
IPCRun
|
||||
JSON
|
||||
LWPProtocolHttps
|
||||
ModuleInstall
|
||||
NetSNMP
|
||||
TestCompile
|
||||
TestDeep
|
||||
TestException
|
||||
TestMockModule
|
||||
TestMockObject
|
||||
TestNoWarnings
|
||||
]);
|
||||
propagatedBuildInputs = with perlPackages; [
|
||||
FileWhich
|
||||
LWP
|
||||
NetIP
|
||||
TextTemplate
|
||||
UNIVERSALrequire
|
||||
XMLTreePP
|
||||
];
|
||||
|
||||
# Test fails due to "Argument list too long"
|
||||
doCheck = false;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
|
||||
cp -r bin $out
|
||||
cp -r lib $out
|
||||
cp -r share $out
|
||||
|
||||
for cur in $out/bin/*; do
|
||||
if [ -x "$cur" ]; then
|
||||
sed -e "s|./lib|$out/lib|" -i "$cur"
|
||||
wrapProgram "$cur" --prefix PATH : ${lib.makeBinPath [nix dmidecode pciutils usbutils nettools iproute2]}
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.fusioninventory.org";
|
||||
description = "FusionInventory unified Agent for UNIX, Linux, Windows and MacOSX";
|
||||
license = lib.licenses.gpl2;
|
||||
maintainers = [ maintainers.phile314 ];
|
||||
};
|
||||
}
|
||||
46
pkgs/servers/monitoring/grafana-agent/default.nix
Normal file
46
pkgs/servers/monitoring/grafana-agent/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, systemd }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "grafana-agent";
|
||||
version = "0.24.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "grafana";
|
||||
repo = "agent";
|
||||
sha256 = "sha256-WxULVtqKxYXMWNY4l0wvTkqcDkPrlHcS70NgQhe8nzU=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-hdo8uiVJAMMPo1N8kLDFPSbyTr5WxNKtq8E7pj6Plak=";
|
||||
|
||||
tags = [
|
||||
"nonetwork"
|
||||
"nodocker"
|
||||
];
|
||||
|
||||
# uses go-systemd, which uses libsystemd headers
|
||||
# https://github.com/coreos/go-systemd/issues/351
|
||||
NIX_CFLAGS_COMPILE = [ "-I${lib.getDev systemd}/include" ];
|
||||
|
||||
# tries to access /sys: https://github.com/grafana/agent/issues/333
|
||||
preBuild = ''
|
||||
rm pkg/integrations/node_exporter/node_exporter_test.go
|
||||
'';
|
||||
|
||||
# go-systemd uses libsystemd under the hood, which does dlopen(libsystemd) at
|
||||
# runtime.
|
||||
# Add to RUNPATH so it can be found.
|
||||
postFixup = ''
|
||||
patchelf \
|
||||
--set-rpath "${lib.makeLibraryPath [ (lib.getLib systemd) ]}:$(patchelf --print-rpath $out/bin/agent)" \
|
||||
$out/bin/agent
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A lightweight subset of Prometheus and more, optimized for Grafana Cloud";
|
||||
license = licenses.asl20;
|
||||
homepage = "https://grafana.com/products/cloud";
|
||||
maintainers = with maintainers; [ flokli ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
77
pkgs/servers/monitoring/grafana-image-renderer/default.nix
Normal file
77
pkgs/servers/monitoring/grafana-image-renderer/default.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ lib, mkYarnPackage, fetchFromGitHub, nodejs, runtimeShell
|
||||
, nodePackages, python3, vips, glib, pkg-config
|
||||
}:
|
||||
|
||||
# Notes for the upgrade:
|
||||
# * Download the tarball of the new version to use.
|
||||
# * Remove the `resolutions`-section from upstream `package.json`
|
||||
# as this breaks with `yarn2nix`.
|
||||
# * Regenerate `yarn.lock` and `yarn2nix --no-patch`.
|
||||
# * Replace new `package.json`, `yarn.nix`, `yarn.lock` here.
|
||||
# * Update `version`+`hash` and rebuild.
|
||||
|
||||
mkYarnPackage rec {
|
||||
pname = "grafana-image-renderer";
|
||||
version = "3.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "grafana";
|
||||
repo = "grafana-image-renderer";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-6yw+zp83T6VVa4A9KYX6rzMKG5GoyJ7M8Z+cEHE4uts=";
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
pushd deps/renderer
|
||||
npm run build
|
||||
popd
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
dontInstall = true;
|
||||
|
||||
packageJSON = ./package.json;
|
||||
yarnNix = ./yarn.nix;
|
||||
yarnLock = ./yarn.lock;
|
||||
|
||||
pkgConfig.sharp = {
|
||||
nativeBuildInputs = [ nodePackages.node-gyp python3 pkg-config ];
|
||||
buildInputs = [ glib vips ];
|
||||
postInstall = ''
|
||||
node-gyp rebuild
|
||||
'';
|
||||
};
|
||||
|
||||
distPhase = ''
|
||||
runHook preDist
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
pushd deps/renderer
|
||||
install_path="$out/libexec/grafana-image-renderer"
|
||||
mkdir -p $install_path
|
||||
cp -R ../../node_modules $install_path
|
||||
cp -R ./!(node_modules) $install_path
|
||||
popd
|
||||
|
||||
mkdir -p $out/bin
|
||||
cat >$out/bin/grafana-image-renderer <<EOF
|
||||
#! ${runtimeShell}
|
||||
${nodejs}/bin/node $install_path/build/app.js \$@
|
||||
EOF
|
||||
chmod +x $out/bin/grafana-image-renderer
|
||||
|
||||
runHook postDist
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/grafana/grafana-image-renderer";
|
||||
description = "A Grafana backend plugin that handles rendering of panels & dashboards to PNGs using headless browser (Chromium/Chrome)";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ ma27 ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
81
pkgs/servers/monitoring/grafana-image-renderer/package.json
Normal file
81
pkgs/servers/monitoring/grafana-image-renderer/package.json
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
"name": "renderer",
|
||||
"version": "1.0.0",
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/grafana/grafana-image-renderer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"eslint": "eslint . --ext .ts",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"prettier:check": "prettier --list-different \"**/*.ts\"",
|
||||
"prettier:write": "prettier --list-different \"**/*.ts\" --write",
|
||||
"precommit": "npm run eslint & npm run typecheck",
|
||||
"watch": "tsc-watch --onSuccess \"node build/app.js server --config=dev.json\"",
|
||||
"watch:debug": "tsc-watch --onSuccess \"cross-env DEBUG=puppeteer-cluster:* node build/app.js server --config=dev.json\"",
|
||||
"build": "tsc",
|
||||
"start": "node build/app.js --config=dev.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@grpc/grpc-js": "^1.0",
|
||||
"@grpc/proto-loader": "^0.5.4",
|
||||
"@hapi/boom": "^9.1.0",
|
||||
"chokidar": "^3.5.2",
|
||||
"express": "^4.16.3",
|
||||
"express-prom-bundle": "^5.1.5",
|
||||
"google-protobuf": "3.5.0",
|
||||
"lodash": "^4.17.21",
|
||||
"minimist": "^1.2.0",
|
||||
"morgan": "^1.9.0",
|
||||
"on-finished": "^2.3.0",
|
||||
"prom-client": "^11.5.3",
|
||||
"puppeteer": "^13.1.3",
|
||||
"puppeteer-cluster": "^0.22.0",
|
||||
"poolpeteer": "^0.22.0",
|
||||
"sharp": "0.29.3",
|
||||
"unique-filename": "^1.1.0",
|
||||
"winston": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/eslint-config": "^2.5.0",
|
||||
"@types/express": "^4.11.1",
|
||||
"@types/node": "^14.14.41",
|
||||
"cross-env": "7.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^4.32.0",
|
||||
"@typescript-eslint/parser": "^4.32.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-jsdoc": "^36.1.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-react": "^7.26.1",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"husky": "^4.3.8",
|
||||
"lint-staged": "^11.2.0",
|
||||
"pkg": "5.5.2",
|
||||
"prettier": "2.2.1",
|
||||
"tsc-watch": "^4.2.3",
|
||||
"typescript": "^4.3.2"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged && npm run precommit"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"pkg": {
|
||||
"assets": "proto/*"
|
||||
},
|
||||
"bin": "build/app.js",
|
||||
"engines": {
|
||||
"node": ">=14 <=16"
|
||||
},
|
||||
"volta": {
|
||||
"node": "14.16.1"
|
||||
}
|
||||
}
|
||||
3878
pkgs/servers/monitoring/grafana-image-renderer/yarn.lock
Normal file
3878
pkgs/servers/monitoring/grafana-image-renderer/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
4317
pkgs/servers/monitoring/grafana-image-renderer/yarn.nix
Normal file
4317
pkgs/servers/monitoring/grafana-image-renderer/yarn.nix
Normal file
File diff suppressed because it is too large
Load diff
32
pkgs/servers/monitoring/grafana-reporter/default.nix
Normal file
32
pkgs/servers/monitoring/grafana-reporter/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, buildGoPackage, fetchFromGitHub, tetex, makeWrapper }:
|
||||
|
||||
with lib;
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "reporter";
|
||||
version = "2.1.0";
|
||||
rev = "v${version}";
|
||||
|
||||
goPackagePath = "github.com/IzakMarais/reporter";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "IzakMarais";
|
||||
repo = "reporter";
|
||||
sha256 = "1zindyypf634l4dd2rsvp67ryz9mmzq779x9d01apd04wivd9yf1";
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/grafana-reporter \
|
||||
--prefix PATH : ${makeBinPath [ tetex ]}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "PDF report generator from a Grafana dashboard";
|
||||
homepage = "https://github.com/IzakMarais/reporter";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ disassembler ];
|
||||
};
|
||||
}
|
||||
82
pkgs/servers/monitoring/grafana/default.nix
Normal file
82
pkgs/servers/monitoring/grafana/default.nix
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
{ lib, buildGoModule, fetchurl, fetchFromGitHub, nixosTests, tzdata, wire }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "grafana";
|
||||
version = "8.5.3";
|
||||
|
||||
excludedPackages = [ "alert_webhook_listener" "clean-swagger" "release_publisher" "slow_proxy" "slow_proxy_mac" "macaron" ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "grafana";
|
||||
repo = "grafana";
|
||||
sha256 = "sha256-O0R+FsZC//Kj9FBb7Xg2fKxn60h/4ATJiropltGM9EI";
|
||||
};
|
||||
|
||||
srcStatic = fetchurl {
|
||||
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
|
||||
sha256 = "0812lvcdibviy23y61z9ljy1j5d55ziyvf1y69kxmds2hwsj7iwl";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-ZL+A6Sz0uHg7ZzYHmA4EU5ZxfRXBLyKglk135iQT600=";
|
||||
|
||||
nativeBuildInputs = [ wire ];
|
||||
|
||||
preBuild = ''
|
||||
# Generate DI code that's required to compile the package.
|
||||
# From https://github.com/grafana/grafana/blob/v8.2.3/Makefile#L33-L35
|
||||
wire gen -tags oss ./pkg/server
|
||||
wire gen -tags oss ./pkg/cmd/grafana-cli/runner
|
||||
|
||||
# The testcase makes an API call against grafana.com:
|
||||
#
|
||||
# [...]
|
||||
# grafana> t=2021-12-02T14:24:58+0000 lvl=dbug msg="Failed to get latest.json repo from github.com" logger=update.checker error="Get \"https://raw.githubusercontent.com/grafana/grafana/main/latest.json\": dial tcp: lookup raw.githubusercontent.com on [::1]:53: read udp [::1]:36391->[::1]:53: read: connection refused"
|
||||
# grafana> t=2021-12-02T14:24:58+0000 lvl=dbug msg="Failed to get plugins repo from grafana.com" logger=plugin.manager error="Get \"https://grafana.com/api/plugins/versioncheck?slugIn=&grafanaVersion=\": dial tcp: lookup grafana.com on [::1]:53: read udp [::1]:41796->[::1]:53: read: connection refused"
|
||||
sed -i -e '/Request is not forbidden if from an admin/a t.Skip();' pkg/tests/api/plugins/api_plugins_test.go
|
||||
|
||||
# Skip a flaky test (https://github.com/NixOS/nixpkgs/pull/126928#issuecomment-861424128)
|
||||
sed -i -e '/it should change folder successfully and return correct result/{N;s/$/\nt.Skip();/}'\
|
||||
pkg/services/libraryelements/libraryelements_patch_test.go
|
||||
|
||||
|
||||
# main module (github.com/grafana/grafana) does not contain package github.com/grafana/grafana/scripts/go
|
||||
rm -r scripts/go
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s" "-w" "-X main.version=${version}"
|
||||
];
|
||||
|
||||
# Tests start http servers which need to bind to local addresses:
|
||||
# panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
# On Darwin, files under /usr/share/zoneinfo exist, but fail to open in sandbox:
|
||||
# TestValueAsTimezone: date_formats_test.go:33: Invalid has err for input "Europe/Amsterdam": operation not permitted
|
||||
preCheck = ''
|
||||
export ZONEINFO=${tzdata}/share/zoneinfo
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
tar -xvf $srcStatic
|
||||
mkdir -p $out/share/grafana
|
||||
mv grafana-*/{public,conf,tools} $out/share/grafana/
|
||||
|
||||
cp ./conf/defaults.ini $out/share/grafana/conf/
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = { inherit (nixosTests) grafana; };
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
|
||||
license = licenses.agpl3;
|
||||
homepage = "https://grafana.com";
|
||||
maintainers = with maintainers; [ offline fpletz willibutz globin ma27 Frostman ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
mainProgram = "grafana-server";
|
||||
};
|
||||
}
|
||||
7
pkgs/servers/monitoring/grafana/plugins/default.nix
Normal file
7
pkgs/servers/monitoring/grafana/plugins/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ newScope, pkgs }:
|
||||
|
||||
let
|
||||
callPackage = newScope (pkgs // plugins);
|
||||
plugins = import ./plugins.nix { inherit callPackage; };
|
||||
in
|
||||
plugins
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ grafanaPlugin, lib }:
|
||||
|
||||
grafanaPlugin rec {
|
||||
pname = "doitintl-bigquery-datasource";
|
||||
version = "2.0.2";
|
||||
zipHash = "sha256-GE6DNuQ5WtS/2VmXbQBeRdVKDbLlLirWXW51i0RF6Cc=";
|
||||
meta = with lib; {
|
||||
description = "BigQuery DataSource for Grafana";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ jwygoda ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ grafanaPlugin, lib }:
|
||||
|
||||
grafanaPlugin rec {
|
||||
pname = "grafadruid-druid-datasource";
|
||||
version = "1.2.0";
|
||||
zipHash = "sha256-DPeyV2jZquSQcSE+HzvxArWEefs9bFNPjZwDFp+dIjg=";
|
||||
meta = with lib; {
|
||||
description = "Connects Grafana to Druid";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ nukaduka ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ grafanaPlugin, lib }:
|
||||
|
||||
grafanaPlugin rec {
|
||||
pname = "grafana-clock-panel";
|
||||
version = "1.1.3";
|
||||
zipHash = "sha256-80JaMhY/EduSWvFrScfua99DGhT/FJUqY/kl0CafKCs=";
|
||||
meta = with lib; {
|
||||
description = "Clock panel for Grafana";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ lukegb ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ grafanaPlugin, lib }:
|
||||
|
||||
grafanaPlugin rec {
|
||||
pname = "grafana-piechart-panel";
|
||||
version = "1.6.2";
|
||||
zipHash = "sha256-xKyVT092Ffgzl0BewQw5iZ14I/q6CviUR5t9BVM0bf0=";
|
||||
meta = with lib; {
|
||||
description = "Pie chart panel for Grafana";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ lukegb ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
28
pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix
Normal file
28
pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ stdenvNoCC, fetchurl, unzip }:
|
||||
|
||||
{ pname, version, zipHash, meta ? {}, passthru ? {}, ... }@args:
|
||||
stdenvNoCC.mkDerivation ({
|
||||
inherit pname version;
|
||||
|
||||
src = fetchurl {
|
||||
name = "${pname}-${version}.zip";
|
||||
url = "https://grafana.com/api/plugins/${pname}/versions/${version}/download";
|
||||
hash = zipHash;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
installPhase = ''
|
||||
cp -R "." "$out"
|
||||
chmod -R a-w "$out"
|
||||
chmod u+w "$out"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = [ ./update-grafana-plugin.sh pname ];
|
||||
} // passthru;
|
||||
|
||||
meta = {
|
||||
homepage = "https://grafana.com/grafana/plugins/${pname}";
|
||||
} // meta;
|
||||
} // (builtins.removeAttrs args [ "pname" "version" "sha256" "meta" ]))
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ grafanaPlugin, lib }:
|
||||
|
||||
grafanaPlugin rec {
|
||||
pname = "grafana-polystat-panel";
|
||||
version = "1.2.6";
|
||||
zipHash = "sha256-gbMD2o8A2YYZzkpYiXNkv8Oj958RP47fL6DXj1SBYF0=";
|
||||
meta = with lib; {
|
||||
description = "Hexagonal multi-stat panel for Grafana";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ lukegb ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ grafanaPlugin, lib }:
|
||||
|
||||
grafanaPlugin rec {
|
||||
pname = "grafana-worldmap-panel";
|
||||
version = "0.3.3";
|
||||
zipHash = "sha256-3n1p3SvcBQMmnbnHimLBP7hauVV1IS3SMwttUWTNvb8=";
|
||||
meta = with lib; {
|
||||
description = "World Map panel for Grafana";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ lukegb ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
13
pkgs/servers/monitoring/grafana/plugins/plugins.nix
Normal file
13
pkgs/servers/monitoring/grafana/plugins/plugins.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ callPackage }:
|
||||
{
|
||||
inherit callPackage;
|
||||
|
||||
grafanaPlugin = callPackage ./grafana-plugin.nix { };
|
||||
|
||||
doitintl-bigquery-datasource = callPackage ./doitintl-bigquery-datasource { };
|
||||
grafadruid-druid-datasource = callPackage ./grafadruid-druid-datasource { };
|
||||
grafana-clock-panel = callPackage ./grafana-clock-panel { };
|
||||
grafana-piechart-panel = callPackage ./grafana-piechart-panel { };
|
||||
grafana-polystat-panel = callPackage ./grafana-polystat-panel { };
|
||||
grafana-worldmap-panel = callPackage ./grafana-worldmap-panel { };
|
||||
}
|
||||
8
pkgs/servers/monitoring/grafana/plugins/update-grafana-plugin.sh
Executable file
8
pkgs/servers/monitoring/grafana/plugins/update-grafana-plugin.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
readonly plugin_name="$1"
|
||||
readonly latest_version="$(curl "https://grafana.com/api/plugins/${plugin_name}" | jq -r .version)"
|
||||
update-source-version "grafanaPlugins.${plugin_name}" "$latest_version"
|
||||
39
pkgs/servers/monitoring/grafana/update.sh
Executable file
39
pkgs/servers/monitoring/grafana/update.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl common-updater-scripts jq nix nix-prefetch-scripts moreutils
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
FILE="$(nix-instantiate --eval -E 'with import ./. {}; (builtins.unsafeGetAttrPos "version" grafana).file' | tr -d '"')"
|
||||
replaceHash() {
|
||||
old="${1?old hash missing}"
|
||||
new="${2?new hash missing}"
|
||||
awk -v OLD="$old" -v NEW="$new" '{
|
||||
if (i=index($0, OLD)) {
|
||||
$0 = substr($0, 1, i-1) NEW substr($0, i+length(OLD));
|
||||
}
|
||||
print $0;
|
||||
}' "$FILE" | sponge "$FILE"
|
||||
}
|
||||
extractVendorHash() {
|
||||
original="${1?original hash missing}"
|
||||
result="$(nix-build -A grafana.go-modules 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true)"
|
||||
[ -z "$result" ] && { echo "$original"; } || { echo "$result"; }
|
||||
}
|
||||
|
||||
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion grafana" | tr -d '"')"
|
||||
latest="$(curl https://api.github.com/repos/grafana/grafana/releases/latest | jq '.tag_name' -r | tr -d 'v')"
|
||||
|
||||
targetVersion="${1:-$latest}"
|
||||
if [ ! "${oldVersion}" = "${targetVersion}" ]; then
|
||||
update-source-version grafana "${targetVersion#v}"
|
||||
oldStaticHash="$(nix-instantiate --eval -A grafana.srcStatic.outputHash | tr -d '"')"
|
||||
newStaticHash="$(nix-prefetch-url "https://dl.grafana.com/oss/release/grafana-${targetVersion#v}.linux-amd64.tar.gz")"
|
||||
replaceHash "$oldStaticHash" "$newStaticHash"
|
||||
goHash="$(nix-instantiate --eval -A grafana.vendorSha256 | tr -d '"')"
|
||||
emptyHash="$(nix-instantiate --eval -A lib.fakeSha256 | tr -d '"')"
|
||||
replaceHash "$goHash" "$emptyHash"
|
||||
replaceHash "$emptyHash" "$(extractVendorHash "$goHash")"
|
||||
nix-build -A grafana
|
||||
else
|
||||
echo "grafana is already up-to-date"
|
||||
fi
|
||||
97
pkgs/servers/monitoring/icinga2/default.nix
Normal file
97
pkgs/servers/monitoring/icinga2/default.nix
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
{ stdenv, runCommand, lib, fetchFromGitHub, fetchpatch, cmake, flex, bison, systemd
|
||||
, boost, openssl, patchelf, mariadb-connector-c, postgresql, zlib, tzdata
|
||||
# Databases
|
||||
, withMysql ? true, withPostgresql ? false
|
||||
# Features
|
||||
, withChecker ? true, withCompat ? false, withLivestatus ? false
|
||||
, withNotification ? true, withPerfdata ? true, withIcingadb ? true
|
||||
, nameSuffix ? "" }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "icinga2${nameSuffix}";
|
||||
version = "2.13.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "icinga";
|
||||
repo = "icinga2";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256:1z8wzhlhl8vb7m8axvayfyqgf86lz67gaa02n3r17049vwswdgmb";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./etc-icinga2.patch # Makes /etc/icinga2 relative to / instead of the store path
|
||||
./no-systemd-service.patch # Prevent systemd service from being written to /usr
|
||||
./no-var-directories.patch # Prevent /var directories from being created
|
||||
];
|
||||
|
||||
cmakeFlags = let
|
||||
mkFeatureFlag = label: value: "-DICINGA2_WITH_${label}=${if value then "ON" else "OFF"}";
|
||||
in [
|
||||
# Paths
|
||||
"-DCMAKE_INSTALL_SYSCONFDIR=etc"
|
||||
"-DCMAKE_INSTALL_LOCALSTATEDIR=/var"
|
||||
"-DCMAKE_INSTALL_FULL_SBINDIR=bin"
|
||||
"-DICINGA2_RUNDIR=/run"
|
||||
"-DMYSQL_INCLUDE_DIR=${mariadb-connector-c.dev}/include/mariadb"
|
||||
"-DMYSQL_LIB=${mariadb-connector-c.out}/lib/mariadb/libmysqlclient.a"
|
||||
"-DICINGA2_PLUGINDIR=bin"
|
||||
"-DICINGA2_LTO_BUILD=yes"
|
||||
# Features
|
||||
(mkFeatureFlag "MYSQL" withMysql)
|
||||
(mkFeatureFlag "PGSQL" withPostgresql)
|
||||
(mkFeatureFlag "CHECKER" withChecker)
|
||||
(mkFeatureFlag "COMPAT" withCompat)
|
||||
(mkFeatureFlag "LIVESTATUS" withLivestatus)
|
||||
(mkFeatureFlag "NOTIFICATION" withNotification)
|
||||
(mkFeatureFlag "PERFDATA" withPerfdata)
|
||||
(mkFeatureFlag "ICINGADB" withIcingadb)
|
||||
# Misc.
|
||||
"-DICINGA2_USER=icinga2"
|
||||
"-DICINGA2_GROUP=icinga2"
|
||||
"-DICINGA2_GIT_VERSION_INFO=OFF"
|
||||
"-DUSE_SYSTEMD=ON"
|
||||
];
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
buildInputs = [ boost openssl systemd ]
|
||||
++ lib.optional withPostgresql postgresql;
|
||||
|
||||
nativeBuildInputs = [ cmake flex bison patchelf ];
|
||||
|
||||
doCheck = true;
|
||||
checkInputs = [ tzdata ]; # legacytimeperiod/dst needs this
|
||||
|
||||
postFixup = ''
|
||||
rm -r $out/etc/logrotate.d $out/etc/sysconfig $out/lib/icinga2/prepare-dirs
|
||||
|
||||
# Fix hardcoded paths
|
||||
sed -i 's:/usr/bin/::g' $out/etc/icinga2/scripts/*
|
||||
|
||||
# Get rid of sbin
|
||||
sed -i 's/sbin/bin/g' $out/lib/icinga2/safe-reload
|
||||
rm $out/sbin
|
||||
|
||||
${lib.optionalString withMysql ''
|
||||
# Add dependencies of the MySQL shim to the shared library
|
||||
patchelf --add-needed ${zlib.out}/lib/libz.so $(readlink -f $out/lib/icinga2/libmysql_shim.so)
|
||||
|
||||
# Make Icinga find the MySQL shim
|
||||
icinga2Bin=$out/lib/icinga2/sbin/icinga2
|
||||
patchelf --set-rpath $out/lib/icinga2:$(patchelf --print-rpath $icinga2Bin) $icinga2Bin
|
||||
''}
|
||||
'';
|
||||
|
||||
vim = runCommand "vim-icinga2-${version}" {} ''
|
||||
mkdir -p $out/share/vim-plugins
|
||||
cp -r "${src}/tools/syntax/vim" $out/share/vim-plugins/icinga2
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Open source monitoring system";
|
||||
homepage = "https://www.icinga.com";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ das_j ];
|
||||
};
|
||||
}
|
||||
13
pkgs/servers/monitoring/icinga2/etc-icinga2.patch
Normal file
13
pkgs/servers/monitoring/icinga2/etc-icinga2.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/config.h.cmake b/config.h.cmake
|
||||
index 16fa190..152bf43 100644
|
||||
--- a/config.h.cmake
|
||||
+++ b/config.h.cmake
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#cmakedefine ICINGA2_UNITY_BUILD
|
||||
|
||||
-#define ICINGA_CONFIGDIR "${ICINGA2_FULL_CONFIGDIR}"
|
||||
+#define ICINGA_CONFIGDIR "/etc/icinga2"
|
||||
#define ICINGA_DATADIR "${ICINGA2_FULL_DATADIR}"
|
||||
#define ICINGA_LOGDIR "${ICINGA2_FULL_LOGDIR}"
|
||||
#define ICINGA_CACHEDIR "${ICINGA2_FULL_CACHEDIR}"
|
||||
15
pkgs/servers/monitoring/icinga2/no-systemd-service.patch
Normal file
15
pkgs/servers/monitoring/icinga2/no-systemd-service.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/etc/initsystem/CMakeLists.txt b/etc/initsystem/CMakeLists.txt
|
||||
index e702c83..c23cabb 100644
|
||||
--- a/etc/initsystem/CMakeLists.txt
|
||||
+++ b/etc/initsystem/CMakeLists.txt
|
||||
@@ -50,10 +50,5 @@ if(NOT WIN32)
|
||||
|
||||
if (USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT)
|
||||
configure_file(icinga2.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service @ONLY)
|
||||
- install(
|
||||
- FILES ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.service
|
||||
- DESTINATION ${DESTDIR}/usr/lib/systemd/system
|
||||
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
- )
|
||||
endif()
|
||||
endif()
|
||||
66
pkgs/servers/monitoring/icinga2/no-var-directories.patch
Normal file
66
pkgs/servers/monitoring/icinga2/no-var-directories.patch
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
diff --git a/icinga-app/CMakeLists.txt b/icinga-app/CMakeLists.txt
|
||||
index 87993df..819c87b 100644
|
||||
--- a/icinga-app/CMakeLists.txt
|
||||
+++ b/icinga-app/CMakeLists.txt
|
||||
@@ -106,7 +106,3 @@ install(
|
||||
TARGETS icinga-app
|
||||
RUNTIME DESTINATION ${InstallPath}
|
||||
)
|
||||
-
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_INITRUNDIR}\")")
|
||||
diff --git a/lib/base/CMakeLists.txt b/lib/base/CMakeLists.txt
|
||||
index 5dda179..22cf69f 100644
|
||||
--- a/lib/base/CMakeLists.txt
|
||||
+++ b/lib/base/CMakeLists.txt
|
||||
@@ -125,7 +125,4 @@ set_target_properties (
|
||||
FOLDER Lib
|
||||
)
|
||||
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_CACHEDIR}\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}/crash\")")
|
||||
-
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
|
||||
diff --git a/lib/perfdata/CMakeLists.txt b/lib/perfdata/CMakeLists.txt
|
||||
index ab963f7..3d9d506 100644
|
||||
--- a/lib/perfdata/CMakeLists.txt
|
||||
+++ b/lib/perfdata/CMakeLists.txt
|
||||
@@ -74,7 +74,4 @@ install_if_not_exists(
|
||||
${ICINGA2_CONFIGDIR}/features-available
|
||||
)
|
||||
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_SPOOLDIR}/perfdata\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_SPOOLDIR}/tmp\")")
|
||||
-
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
|
||||
diff --git a/lib/remote/CMakeLists.txt b/lib/remote/CMakeLists.txt
|
||||
index 65113d2..5e4398f 100644
|
||||
--- a/lib/remote/CMakeLists.txt
|
||||
+++ b/lib/remote/CMakeLists.txt
|
||||
@@ -55,12 +55,3 @@ set_target_properties (
|
||||
remote PROPERTIES
|
||||
FOLDER Lib
|
||||
)
|
||||
-
|
||||
-#install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/api\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/api/log\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/api/zones\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/api/zones-stage\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/certs\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/certificate-requests\")")
|
||||
-
|
||||
-
|
||||
diff --git a/lib/compat/CMakeLists.txt b/lib/compat/CMakeLists.txt
|
||||
index 1438626..d882ae2 100644
|
||||
--- a/lib/compat/CMakeLists.txt
|
||||
+++ b/lib/compat/CMakeLists.txt
|
||||
@@ -55,8 +55,4 @@ install_if_not_exists(
|
||||
${ICINGA2_CONFIGDIR}/features-available
|
||||
)
|
||||
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}/compat/archives\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_SPOOLDIR}\")")
|
||||
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_INITRUNDIR}/cmd\")")
|
||||
-
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
|
||||
23
pkgs/servers/monitoring/kapacitor/default.nix
Normal file
23
pkgs/servers/monitoring/kapacitor/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ lib, fetchFromGitHub, buildGoPackage }:
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "kapacitor";
|
||||
version = "1.5.7";
|
||||
|
||||
goPackagePath = "github.com/influxdata/kapacitor";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "influxdata";
|
||||
repo = "kapacitor";
|
||||
rev = "v${version}";
|
||||
sha256 = "0lzx25d4y5d8rsddgnypfskcxa5qlwc294sdzmn8dlq995yphpac";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Open source framework for processing, monitoring, and alerting on time series data";
|
||||
license = licenses.mit;
|
||||
homepage = "https://influxdata.com/time-series-platform/kapacitor/";
|
||||
maintainers = with maintainers; [ offline ];
|
||||
platforms = with platforms; linux;
|
||||
};
|
||||
}
|
||||
78
pkgs/servers/monitoring/lcdproc/default.nix
Normal file
78
pkgs/servers/monitoring/lcdproc/default.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, autoreconfHook
|
||||
, makeWrapper
|
||||
, pkg-config
|
||||
, doxygen
|
||||
, freetype
|
||||
, libX11
|
||||
, libftdi
|
||||
, libusb-compat-0_1
|
||||
, libusb1
|
||||
, ncurses
|
||||
, perl
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lcdproc";
|
||||
version = "0.5.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lcdproc";
|
||||
repo = "lcdproc";
|
||||
rev = "v${version}";
|
||||
sha256 = "1r885zv1gsh88j43x6fvzbdgfkh712a227d369h4fdcbnnfd0kpm";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./hardcode_mtab.patch
|
||||
|
||||
# Pull upstream fix for -fno-common toolchains:
|
||||
# https://github.com/lcdproc/lcdproc/pull/148
|
||||
(fetchpatch {
|
||||
name = "fno-common.patch";
|
||||
url = "https://github.com/lcdproc/lcdproc/commit/fda5302878692da933dc03cd011f8ddffefa07a4.patch";
|
||||
sha256 = "0ld6p1r4rjsnjr63afw3lp5lx25jxjs07lsp9yc3q96r91r835cy";
|
||||
})
|
||||
];
|
||||
|
||||
# we don't need to see the GPL every time we launch lcdd in the foreground
|
||||
postPatch = ''
|
||||
substituteInPlace server/main.c \
|
||||
--replace 'output_GPL_notice();' '// output_GPL_notice();'
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--enable-lcdproc-menus"
|
||||
"--enable-drivers=all"
|
||||
"--with-pidfile-dir=/run"
|
||||
];
|
||||
|
||||
buildInputs = [ freetype libX11 libftdi libusb-compat-0_1 libusb1 ncurses ];
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook doxygen makeWrapper pkg-config ];
|
||||
|
||||
# In 0.5.9: gcc: error: libbignum.a: No such file or directory
|
||||
enableParallelBuilding = false;
|
||||
|
||||
postFixup = ''
|
||||
for f in $out/bin/*.pl ; do
|
||||
substituteInPlace $f \
|
||||
--replace /usr/bin/perl ${lib.getBin perl}/bin/perl
|
||||
done
|
||||
|
||||
# NixOS will not use this file anyway but at least we can now execute LCDd
|
||||
substituteInPlace $out/etc/LCDd.conf \
|
||||
--replace server/drivers/ $out/lib/lcdproc/
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Client/server suite for controlling a wide variety of LCD devices";
|
||||
homepage = "http://lcdproc.org/";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
17
pkgs/servers/monitoring/lcdproc/hardcode_mtab.patch
Normal file
17
pkgs/servers/monitoring/lcdproc/hardcode_mtab.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/clients/lcdproc/machine_Linux.c b/clients/lcdproc/machine_Linux.c
|
||||
index 7bb7266..a629674 100644
|
||||
--- a/clients/lcdproc/machine_Linux.c
|
||||
+++ b/clients/lcdproc/machine_Linux.c
|
||||
@@ -259,11 +259,7 @@ machine_get_fs(mounts_type fs[], int *cnt)
|
||||
char line[256];
|
||||
int x = 0, err;
|
||||
|
||||
-#ifdef MTAB_FILE
|
||||
- mtab_fd = fopen(MTAB_FILE, "r");
|
||||
-#else
|
||||
-#error "Can't find your mounted filesystem table file."
|
||||
-#endif
|
||||
+ mtab_fd = fopen("/etc/mtab", "r");
|
||||
|
||||
/* Get rid of old, unmounted filesystems... */
|
||||
memset(fs, 0, sizeof(mounts_type) * 256);
|
||||
60
pkgs/servers/monitoring/loki/default.nix
Normal file
60
pkgs/servers/monitoring/loki/default.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, nixosTests
|
||||
, systemd
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
version = "2.5.0";
|
||||
pname = "grafana-loki";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "grafana";
|
||||
repo = "loki";
|
||||
sha256 = "sha256-3GeWrkTL3HJQsVBafjSQXHsf1nbVzSVSDZWcJlD22Nw=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
||||
subPackages = [
|
||||
# TODO split every executable into its own package
|
||||
"cmd/loki"
|
||||
"cmd/loki-canary"
|
||||
"clients/cmd/promtail"
|
||||
"cmd/logcli"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = lib.optionals stdenv.isLinux [ systemd.dev ];
|
||||
|
||||
preFixup = lib.optionalString stdenv.isLinux ''
|
||||
wrapProgram $out/bin/promtail \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests) loki; };
|
||||
|
||||
ldflags = let t = "github.com/grafana/loki/pkg/util/build"; in [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X ${t}.Version=${version}"
|
||||
"-X ${t}.BuildUser=nix@nixpkgs"
|
||||
"-X ${t}.BuildDate=unknown"
|
||||
"-X ${t}.Branch=unknown"
|
||||
"-X ${t}.Revision=unknown"
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Like Prometheus, but for logs";
|
||||
license = with licenses; [ agpl3Only asl20 ];
|
||||
homepage = "https://grafana.com/oss/loki/";
|
||||
maintainers = with maintainers; [ willibutz globin mmahut ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
69
pkgs/servers/monitoring/longview/default.nix
Normal file
69
pkgs/servers/monitoring/longview/default.nix
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, glibc }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.1.5";
|
||||
pname = "longview";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "linode";
|
||||
repo = "longview";
|
||||
rev = "v${version}";
|
||||
sha256 = "1i9lli8iw8sb1bd633i82fzhx5gz85ma9d1hra41pkv2p3h823pa";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# log to systemd journal
|
||||
./log-stdout.patch
|
||||
];
|
||||
|
||||
# Read all configuration from /run/longview
|
||||
postPatch = ''
|
||||
substituteInPlace Linode/Longview/Util.pm \
|
||||
--replace /var/run/longview.pid /run/longview/longview.pid \
|
||||
--replace /etc/linode /run/longview
|
||||
substituteInPlace Linode/Longview.pl \
|
||||
--replace /etc/linode /run/longview
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ perl glibc ]
|
||||
++ (with perlPackages; [
|
||||
LWP
|
||||
LWPProtocolHttps
|
||||
MozillaCA
|
||||
CryptSSLeay
|
||||
IOSocketInet6
|
||||
LinuxDistribution
|
||||
JSONPP
|
||||
JSON
|
||||
LogLogLite
|
||||
TryTiny
|
||||
DBI
|
||||
DBDmysql
|
||||
]);
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/usr
|
||||
mv Linode $out
|
||||
ln -s ../Linode/Longview.pl $out/bin/longview
|
||||
for h in syscall.h sys/syscall.h asm/unistd.h asm/unistd_32.h asm/unistd_64.h bits/wordsize.h bits/syscall.h; do
|
||||
${perl}/bin/h2ph -d $out ${glibc.dev}/include/$h
|
||||
mkdir -p $out/usr/include/$(dirname $h)
|
||||
mv $out${glibc.dev}/include/''${h%.h}.ph $out/usr/include/$(dirname $h)
|
||||
done
|
||||
wrapProgram $out/Linode/Longview.pl --prefix PATH : ${perl}/bin:$out/bin \
|
||||
--suffix PERL5LIB : $out/Linode --suffix PERL5LIB : $PERL5LIB \
|
||||
--suffix PERL5LIB : $out --suffix INC : $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.linode.com/longview";
|
||||
description = "Collects all of your system-level metrics and sends them to Linode";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = [ maintainers.rvl ];
|
||||
inherit version;
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
};
|
||||
}
|
||||
38
pkgs/servers/monitoring/longview/log-stdout.patch
Normal file
38
pkgs/servers/monitoring/longview/log-stdout.patch
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
diff -ru longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Logger.pm longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Logger.pm
|
||||
--- longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Logger.pm 2015-10-28 17:15:32.816515318 +0000
|
||||
+++ longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Logger.pm 2015-10-28 18:00:50.760332026 +0000
|
||||
@@ -26,9 +26,7 @@
|
||||
my ( $self, $message ) = @_;
|
||||
|
||||
my $ts = strftime( '%m/%d %T', localtime );
|
||||
- $self->{logger}->write(
|
||||
- sprintf( '%s %s Longview[%i] - %s', $ts, uc($level), $$, $message ),
|
||||
- $levels->{$level} );
|
||||
+ printf( "%s %s Longview[%i] - %s\n", $ts, uc($level), $$, $message );
|
||||
die "$message" if $level eq 'logdie';
|
||||
};
|
||||
}
|
||||
@@ -37,12 +35,6 @@
|
||||
my ( $class, $level ) = @_;
|
||||
my $self = {};
|
||||
|
||||
- mkpath($LOGDIR) unless (-d $LOGDIR);
|
||||
- $self->{logger}
|
||||
- = Log::LogLite->new( $LOGDIR . 'longview.log', $level )
|
||||
- or die "Couldn't create logger object: $!";
|
||||
- $self->{logger}->template("<message>\n");
|
||||
-
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
diff -ru longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Util.pm longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Util.pm
|
||||
--- longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Util.pm 2015-10-28 17:15:32.816515318 +0000
|
||||
+++ longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Util.pm 2015-10-28 19:20:30.894314658 +0000
|
||||
@@ -225,7 +225,6 @@
|
||||
#<<< perltidy ignore
|
||||
chdir '/' or $logger->logdie("Can't chdir to /: $!");
|
||||
open STDIN, '<', '/dev/null' or $logger->logdie("Can't read /dev/null: $!");
|
||||
- open STDOUT, '>>', '/dev/null' or $logger->logdie("Can't write to /dev/null: $!");
|
||||
open STDERR, '>>', '/dev/null' or $logger->logdie("Can't write to /dev/null: $!");
|
||||
tie *STDERR, "Linode::Longview::STDERRLogger";
|
||||
defined( my $pid = fork ) or $logger->logdie("Can't fork: $!");
|
||||
40
pkgs/servers/monitoring/mackerel-agent/default.nix
Normal file
40
pkgs/servers/monitoring/mackerel-agent/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "mackerel-agent";
|
||||
version = "0.72.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mackerelio";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-+3a0FyVf5AB85gGGBI8/ssLBqj9Kp3w9DUNbSaAtXvA=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
checkInputs = lib.optionals (!stdenv.isDarwin) [ nettools ];
|
||||
buildInputs = lib.optionals (!stdenv.isDarwin) [ iproute2 ];
|
||||
|
||||
vendorSha256 = "sha256-4hdy+Yr9EoUjJ4+pJ2ZEPGlnq+4sx5JLm92eFFav6tU=";
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
ldflags = [
|
||||
"-X=main.version=${version}"
|
||||
"-X=main.gitcommit=v${version}"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/mackerel-agent \
|
||||
--prefix PATH : "${lib.makeBinPath buildInputs}"
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "System monitoring service for mackerel.io";
|
||||
homepage = "https://github.com/mackerelio/mackerel-agent";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ midchildan ];
|
||||
};
|
||||
}
|
||||
39
pkgs/servers/monitoring/matrix-alertmanager/default.nix
Normal file
39
pkgs/servers/monitoring/matrix-alertmanager/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, callPackage, mkYarnPackage, fetchYarnDeps, fetchFromGitHub, nodejs }:
|
||||
|
||||
mkYarnPackage rec {
|
||||
pname = "matrix-alertmanager";
|
||||
version = "0.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jaywink";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "M3/8viRCRiVJGJSHidP6nG8cr8wOl9hMFY/gzdSRN+4=";
|
||||
};
|
||||
|
||||
packageJSON = ./package.json;
|
||||
yarnLock = ./yarn.lock;
|
||||
|
||||
offlineCache = fetchYarnDeps {
|
||||
inherit yarnLock;
|
||||
sha256 = lib.fileContents ./yarn-hash;
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
cp ${./package.json} ./package.json
|
||||
'';
|
||||
postInstall = ''
|
||||
sed '1 s;^;#!${nodejs}/bin/node\n;' -i $out/libexec/matrix-alertmanager/node_modules/matrix-alertmanager/src/app.js
|
||||
chmod +x $out/libexec/matrix-alertmanager/node_modules/matrix-alertmanager/src/app.js
|
||||
'';
|
||||
|
||||
passthru.updateScript = callPackage ./update.nix {};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Bot to receive Alertmanager webhook events and forward them to chosen rooms";
|
||||
homepage = "https://github.com/jaywink/matrix-alertmanager";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ yuka ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
41
pkgs/servers/monitoring/matrix-alertmanager/package.json
Normal file
41
pkgs/servers/monitoring/matrix-alertmanager/package.json
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "matrix-alertmanager",
|
||||
"version": "0.5.0",
|
||||
"description": "Prometheus Alertmanager bot for Matrix",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
"dev": "node_modules/.bin/nodemon src/app.js localhost 3000",
|
||||
"test": "node_modules/.bin/mocha tests/",
|
||||
"start": "node src/app.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jaywink/matrix-alertmanager"
|
||||
},
|
||||
"keywords": [
|
||||
"matrix",
|
||||
"alertmanager",
|
||||
"prometheus",
|
||||
"bot"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
},
|
||||
"author": "Jason Robinson",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.4",
|
||||
"eslint": "^7.32.0",
|
||||
"mocha": "^9.1.1",
|
||||
"nodemon": "^2.0.12",
|
||||
"npm-check-updates": "^11.8.5",
|
||||
"sinon": "^11.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotenv": "^10.0.0",
|
||||
"express": "^4.17.1",
|
||||
"matrix-js-sdk": "^12.5.0",
|
||||
"striptags": "^3.2.0"
|
||||
},
|
||||
"bin": "src/app.js"
|
||||
}
|
||||
32
pkgs/servers/monitoring/matrix-alertmanager/update.nix
Executable file
32
pkgs/servers/monitoring/matrix-alertmanager/update.nix
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, writeShellScript
|
||||
, coreutils, jq, common-updater-scripts
|
||||
, curl, wget, gnugrep, yarn, prefetch-yarn-deps
|
||||
}:
|
||||
|
||||
writeShellScript "update-matrix-alertmanager" ''
|
||||
set -xe
|
||||
export PATH="${lib.makeBinPath [ gnugrep coreutils curl wget jq common-updater-scripts yarn prefetch-yarn-deps ]}"
|
||||
|
||||
cd pkgs/servers/monitoring/matrix-alertmanager/
|
||||
|
||||
owner="jaywink"
|
||||
repo="matrix-alertmanager"
|
||||
version=`curl -s "https://api.github.com/repos/$owner/$repo/tags" | jq -r .[0].name | grep -oP "^v\K.*"`
|
||||
url="https://raw.githubusercontent.com/$owner/$repo/v$version/"
|
||||
|
||||
(
|
||||
cd ../../../..
|
||||
update-source-version matrix-alertmanager "$version" --file=pkgs/servers/monitoring/matrix-alertmanager/default.nix
|
||||
)
|
||||
|
||||
rm -f package.json package-lock.json yarn.lock
|
||||
wget "$url/package.json" "$url/package-lock.json"
|
||||
|
||||
yarn import
|
||||
echo $(prefetch-yarn-deps) > yarn-hash
|
||||
|
||||
jq '. + { bin: .main }' package.json > package.json.tmp
|
||||
mv package.json{.tmp,}
|
||||
|
||||
rm -rf package-lock.json node_modules
|
||||
''
|
||||
1
pkgs/servers/monitoring/matrix-alertmanager/yarn-hash
Normal file
1
pkgs/servers/monitoring/matrix-alertmanager/yarn-hash
Normal file
|
|
@ -0,0 +1 @@
|
|||
1vjg0rapdj88ygc00j60w4h5wkaf6jycmlx3fz13xar74ikwrifa
|
||||
3560
pkgs/servers/monitoring/matrix-alertmanager/yarn.lock
Normal file
3560
pkgs/servers/monitoring/matrix-alertmanager/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
42
pkgs/servers/monitoring/mimir/default.nix
Normal file
42
pkgs/servers/monitoring/mimir/default.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
buildGoModule rec {
|
||||
pname = "mimir";
|
||||
version = "2.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "${pname}-${version}";
|
||||
owner = "grafana";
|
||||
repo = pname;
|
||||
sha256 = "sha256-n7Vzp/GQIC+Mryu9SycMZ3ScPo5O+5tA4TdigpKzmLU=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
||||
subPackages = [
|
||||
"cmd/mimir"
|
||||
"cmd/mimirtool"
|
||||
];
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) mimir;
|
||||
};
|
||||
|
||||
ldflags = let t = "github.com/grafana/mimir/pkg/util/version";
|
||||
in [
|
||||
''-extldflags "-static"''
|
||||
"-s"
|
||||
"-w"
|
||||
"-X ${t}.Version=${version}"
|
||||
"-X ${t}.Revision=unknown"
|
||||
"-X ${t}.Branch=unknown"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description =
|
||||
"Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus. ";
|
||||
homepage = "https://github.com/grafana/mimir";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = with maintainers; [ happysalada bryanhonof ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
33
pkgs/servers/monitoring/mtail/default.nix
Normal file
33
pkgs/servers/monitoring/mtail/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, fetchFromGitHub, buildGoModule }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "mtail";
|
||||
version = "3.0.0-rc46";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "google";
|
||||
repo = "mtail";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-/PiwrXr/oG/euWDOqcXvKKvyvQbp11Ks8LjmmJjDtdU=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-aBGJ+JJjm9rt7Ic90iWY7vGtZQN0u6jlBnAMy1nivQM=";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
subPackages = [ "cmd/mtail" ];
|
||||
|
||||
preBuild = ''
|
||||
go generate -x ./internal/vm/
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-X main.Version=${version}"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
license = licenses.asl20;
|
||||
homepage = "https://github.com/google/mtail";
|
||||
description = "Tool for extracting metrics from application logs";
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
commit af5fa3623bb9a73052f9154be4a0f38c60ea42a2
|
||||
Author: Kjetil Orbekk <kjetil.orbekk@gmail.com>
|
||||
Date: Thu Nov 23 21:21:36 2017 -0500
|
||||
|
||||
node: add --sconfdir to set plugin configuration dir
|
||||
|
||||
diff --git a/node/sbin/munin-node b/node/sbin/munin-node
|
||||
index 909c8c4e..0ccf3941 100755
|
||||
--- a/node/sbin/munin-node
|
||||
+++ b/node/sbin/munin-node
|
||||
@@ -100,9 +100,11 @@ sub parse_args
|
||||
my @ORIG_ARGV = @ARGV;
|
||||
|
||||
my $servicedir_cmdline;
|
||||
+ my $sconfdir_cmdline;
|
||||
print_usage_and_exit() unless GetOptions(
|
||||
"config=s" => \$conffile,
|
||||
"servicedir=s" => \$servicedir_cmdline,
|
||||
+ "sconfdir=s" => \$sconfdir_cmdline,
|
||||
"debug!" => \$DEBUG,
|
||||
"pidebug!" => \$PIDEBUG,
|
||||
"paranoia!" => \$paranoia,
|
||||
@@ -112,6 +114,7 @@ sub parse_args
|
||||
|
||||
# We untaint the args brutally, since the sysadm should know what he does
|
||||
$servicedir = $1 if defined $servicedir_cmdline && $servicedir_cmdline =~ m/(.*)/;
|
||||
+ $sconfdir = $1 if defined $sconfdir_cmdline && $sconfdir_cmdline =~ m/(.*)/;
|
||||
|
||||
# Reset ARGV (for HUPing)
|
||||
@ARGV = @ORIG_ARGV;
|
||||
@@ -175,6 +178,10 @@ Use E<lt>fileE<gt> as configuration file. [@@CONFDIR@@/munin-node.conf]
|
||||
|
||||
Override plugin directory [@@CONFDIR@@/plugins/]
|
||||
|
||||
+=item B<< --sconfdir <dir> >>
|
||||
+
|
||||
+Override plugin configuration directory [@@CONFDIR@@/plugin-conf.d/]
|
||||
+
|
||||
=item B< --[no]paranoia >
|
||||
|
||||
Only run plugins owned by root. Check permissions as well. [--noparanoia]
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
From 75a3ec48814e7b9a9b22259a04009076363be3f1 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Kolar <igor.kolar@gmail.com>
|
||||
Date: Thu, 17 Oct 2013 00:48:23 +0200
|
||||
Subject: [PATCH 1/2] node: added --servicedir switch to munin-node
|
||||
|
||||
This code is copied over from munin-node-config, that already does the same
|
||||
---
|
||||
node/sbin/munin-node | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/node/sbin/munin-node b/node/sbin/munin-node
|
||||
index 7b2e180..0a93450 100755
|
||||
--- a/node/sbin/munin-node
|
||||
+++ b/node/sbin/munin-node
|
||||
@@ -35,7 +35,7 @@ use Munin::Node::OS;
|
||||
use Munin::Node::Service;
|
||||
use Munin::Node::Server;
|
||||
|
||||
-my $servicedir;
|
||||
+my $servicedir = "$Munin::Common::Defaults::MUNIN_CONFDIR/plugins";
|
||||
my $sconfdir = "$Munin::Common::Defaults::MUNIN_CONFDIR/plugin-conf.d";
|
||||
my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.conf";
|
||||
my $DEBUG = 0;
|
||||
@@ -101,6 +101,7 @@ sub parse_args
|
||||
|
||||
print_usage_and_exit() unless GetOptions(
|
||||
"config=s" => \$conffile,
|
||||
+ "servicedir=s" => \$servicedir,
|
||||
"debug!" => \$DEBUG,
|
||||
"pidebug!" => \$PIDEBUG,
|
||||
"paranoia!" => \$paranoia,
|
||||
@@ -166,6 +167,10 @@ and returning the output they produce.
|
||||
|
||||
Use E<lt>fileE<gt> as configuration file. [@@CONFDIR@@/munin-node.conf]
|
||||
|
||||
+=item B<< --servicedir <dir> >>
|
||||
+
|
||||
+Override plugin directory [@@CONFDIR@@/plugins/]
|
||||
+
|
||||
=item B< --[no]paranoia >
|
||||
|
||||
Only run plugins owned by root. Check permissions as well. [--noparanoia]
|
||||
--
|
||||
1.8.4
|
||||
|
||||
|
||||
From b8e17cbe73ae4c71b93ff5687ba86db1d0c1f5bd Mon Sep 17 00:00:00 2001
|
||||
From: Steve Schnepp <steve.schnepp@pwkf.org>
|
||||
Date: Thu, 17 Oct 2013 11:52:10 +0200
|
||||
Subject: [PATCH 2/2] node: untaint the service-dir args
|
||||
|
||||
---
|
||||
node/sbin/munin-node | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/node/sbin/munin-node b/node/sbin/munin-node
|
||||
index 0a93450..909c8c4 100755
|
||||
--- a/node/sbin/munin-node
|
||||
+++ b/node/sbin/munin-node
|
||||
@@ -99,9 +99,10 @@ sub parse_args
|
||||
{
|
||||
my @ORIG_ARGV = @ARGV;
|
||||
|
||||
+ my $servicedir_cmdline;
|
||||
print_usage_and_exit() unless GetOptions(
|
||||
"config=s" => \$conffile,
|
||||
- "servicedir=s" => \$servicedir,
|
||||
+ "servicedir=s" => \$servicedir_cmdline,
|
||||
"debug!" => \$DEBUG,
|
||||
"pidebug!" => \$PIDEBUG,
|
||||
"paranoia!" => \$paranoia,
|
||||
@@ -109,6 +110,9 @@ sub parse_args
|
||||
"help" => \&print_usage_and_exit,
|
||||
);
|
||||
|
||||
+ # We untaint the args brutally, since the sysadm should know what he does
|
||||
+ $servicedir = $1 if defined $servicedir_cmdline && $servicedir_cmdline =~ m/(.*)/;
|
||||
+
|
||||
# Reset ARGV (for HUPing)
|
||||
@ARGV = @ORIG_ARGV;
|
||||
|
||||
--
|
||||
1.8.4
|
||||
|
||||
149
pkgs/servers/monitoring/munin/default.nix
Normal file
149
pkgs/servers/monitoring/munin/default.nix
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
{ lib, stdenv, fetchFromGitHub, makeWrapper, which, coreutils, rrdtool, perlPackages
|
||||
, python3, ruby, jre, nettools, bc
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "2.0.69";
|
||||
pname = "munin";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "munin-monitoring";
|
||||
repo = "munin";
|
||||
rev = version;
|
||||
sha256 = "sha256-p273O5JLFX1dA2caV3lVVL9YNTcGMSrC7DWieUfUmqI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
which
|
||||
coreutils
|
||||
rrdtool
|
||||
nettools
|
||||
perlPackages.perl
|
||||
perlPackages.ModuleBuild
|
||||
perlPackages.HTMLTemplate
|
||||
perlPackages.NetCIDR
|
||||
perlPackages.NetSSLeay
|
||||
perlPackages.NetServer
|
||||
perlPackages.LogLog4perl
|
||||
perlPackages.IOSocketInet6
|
||||
perlPackages.Socket6
|
||||
perlPackages.URI
|
||||
perlPackages.DBFile
|
||||
perlPackages.DateManip
|
||||
perlPackages.FileCopyRecursive
|
||||
perlPackages.FCGI
|
||||
perlPackages.NetSNMP
|
||||
perlPackages.NetServer
|
||||
perlPackages.ListMoreUtils
|
||||
perlPackages.LWP
|
||||
perlPackages.DBDPg
|
||||
python3
|
||||
ruby
|
||||
jre
|
||||
# tests
|
||||
perlPackages.TestLongString
|
||||
perlPackages.TestDifferences
|
||||
perlPackages.TestDeep
|
||||
perlPackages.TestMockModule
|
||||
perlPackages.TestMockObject
|
||||
perlPackages.FileSlurp
|
||||
perlPackages.IOStringy
|
||||
];
|
||||
|
||||
# needs to find a local perl module during build
|
||||
PERL_USE_UNSAFE_INC = "1";
|
||||
|
||||
# TODO: tests are failing https://munin-monitoring.org/ticket/1390#comment:1
|
||||
# NOTE: important, test command always exits with 0, think of a way to abort the build once tests pass
|
||||
doCheck = false;
|
||||
|
||||
checkPhase = ''
|
||||
export PERL5LIB="$PERL5LIB:${rrdtool}/${perlPackages.perl.libPrefix}"
|
||||
LC_ALL=C make -j1 test
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# https://rt.cpan.org/Public/Bug/Display.html?id=75112
|
||||
./dont_preserve_source_dir_permissions.patch
|
||||
|
||||
# https://github.com/munin-monitoring/munin/pull/134
|
||||
./adding_servicedir_munin-node.patch
|
||||
|
||||
./adding_sconfdir_munin-node.patch
|
||||
./preserve_environment.patch
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
echo "${version}" > RELEASE
|
||||
substituteInPlace "Makefile" \
|
||||
--replace "/bin/pwd" "pwd" \
|
||||
--replace "HTMLOld.3pm" "HTMLOld.3"
|
||||
|
||||
# munin checks at build time if user/group exists, unpure
|
||||
sed -i '/CHECKUSER/d' Makefile
|
||||
sed -i '/CHOWN/d' Makefile
|
||||
sed -i '/CHECKGROUP/d' Makefile
|
||||
|
||||
# munin hardcodes PATH, we need it to obey $PATH
|
||||
sed -i '/ENV{PATH}/d' node/lib/Munin/Node/Service.pm
|
||||
'';
|
||||
|
||||
# Disable parallel build, errors:
|
||||
# Can't locate Munin/Common/Defaults.pm in @INC ...
|
||||
enableParallelBuilding = false;
|
||||
|
||||
# DESTDIR shouldn't be needed (and shouldn't have worked), but munin
|
||||
# developers have forgotten to use PREFIX everywhere, so we use DESTDIR to
|
||||
# ensure that everything is installed in $out.
|
||||
makeFlags = [
|
||||
"PREFIX=$(out)"
|
||||
"DESTDIR=$(out)"
|
||||
"PERLLIB=$(out)/${perlPackages.perl.libPrefix}"
|
||||
"PERL=${perlPackages.perl.outPath}/bin/perl"
|
||||
"PYTHON=${python3.interpreter}"
|
||||
"RUBY=${ruby.outPath}/bin/ruby"
|
||||
"JAVARUN=${jre.outPath}/bin/java"
|
||||
"PLUGINUSER=munin"
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
echo "Removing references to /usr/{bin,sbin}/ from munin plugins..."
|
||||
find "$out/lib/plugins" -type f -print0 | xargs -0 -L1 \
|
||||
sed -i -e "s|/usr/bin/||g" -e "s|/usr/sbin/||g" -e "s|\<bc\>|${bc}/bin/bc|g"
|
||||
|
||||
if test -e $out/nix-support/propagated-build-inputs; then
|
||||
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
||||
fi
|
||||
|
||||
for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
|
||||
# don't wrap .jar files
|
||||
case "$file" in
|
||||
*.jar) continue;;
|
||||
esac
|
||||
wrapProgram "$file" \
|
||||
--set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${with perlPackages; makePerlPath [
|
||||
LogLog4perl IOSocketInet6 Socket6 URI DBFile DateManip
|
||||
HTMLTemplate FileCopyRecursive FCGI NetCIDR NetSNMP NetServer
|
||||
ListMoreUtils DBDPg LWP rrdtool
|
||||
]}"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Networked resource monitoring tool";
|
||||
longDescription = ''
|
||||
Munin is a monitoring tool that surveys all your computers and remembers
|
||||
what it saw. It presents all the information in graphs through a web
|
||||
interface. Munin can help analyze resource trends and 'what just happened
|
||||
to kill our performance?' problems.
|
||||
'';
|
||||
homepage = "https://munin-monitoring.org/";
|
||||
license = licenses.gpl2;
|
||||
maintainers = [ maintainers.bjornfor ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# https://rt.cpan.org/Public/Bug/Display.html?id=75112
|
||||
diff --git a/master/lib/Munin/Master/HTMLOld.pm b/master/lib/Munin/Master/HTMLOld.pm
|
||||
index 2b6e71f..c0aa2c0 100644
|
||||
--- a/master/lib/Munin/Master/HTMLOld.pm
|
||||
+++ b/master/lib/Munin/Master/HTMLOld.pm
|
||||
@@ -711,10 +711,12 @@ sub emit_main_index {
|
||||
|
||||
sub copy_web_resources {
|
||||
my ($staticdir, $htmldir) = @_;
|
||||
+ local $File::Copy::Recursive::KeepMode = 0;
|
||||
unless(dircopy($staticdir, "$htmldir/static")){
|
||||
ERROR "[ERROR] Could not copy contents from $staticdir to $htmldir";
|
||||
die "[ERROR] Could not copy contents from $staticdir to $htmldir";
|
||||
}
|
||||
+ local $File::Copy::Recursive::KeepMode = 1;
|
||||
}
|
||||
|
||||
sub instanciate_comparison_templates {
|
||||
41
pkgs/servers/monitoring/munin/preserve_environment.patch
Normal file
41
pkgs/servers/monitoring/munin/preserve_environment.patch
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
commit d94c29b7397362857b81d8c877a989fdb28490d8
|
||||
Author: Kjetil Orbekk <kjetil.orbekk@gmail.com>
|
||||
Date: Tue Nov 21 15:37:42 2017 -0500
|
||||
|
||||
Keep environment variables instead of overwriting them.
|
||||
|
||||
diff --git a/common/lib/Munin/Common/Defaults.pm b/common/lib/Munin/Common/Defaults.pm
|
||||
index 131f52c0..bbf42697 100644
|
||||
--- a/common/lib/Munin/Common/Defaults.pm
|
||||
+++ b/common/lib/Munin/Common/Defaults.pm
|
||||
@@ -71,7 +71,7 @@ sub export_to_environment {
|
||||
|
||||
my %defaults = %{$class->get_defaults()};
|
||||
while (my ($k, $v) = each %defaults) {
|
||||
- $ENV{$k} = $v;
|
||||
+ $ENV{$k} = $ENV{$k} || $v;
|
||||
}
|
||||
|
||||
return
|
||||
diff --git a/node/lib/Munin/Node/Service.pm b/node/lib/Munin/Node/Service.pm
|
||||
index 1b4f6114..be58bd77 100644
|
||||
--- a/node/lib/Munin/Node/Service.pm
|
||||
+++ b/node/lib/Munin/Node/Service.pm
|
||||
@@ -122,7 +122,7 @@ sub export_service_environment {
|
||||
# We append the USER to the MUNIN_PLUGSTATE, to avoid CVE-2012-3512
|
||||
my $uid = $self->_resolve_uid($service);
|
||||
my $user = getpwuid($uid);
|
||||
- $ENV{MUNIN_PLUGSTATE} = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/$user";
|
||||
+ $ENV{MUNIN_PLUGSTATE} = "$ENV{MUNIN_PLUGSTATE}/$user";
|
||||
|
||||
# Provide a consistent default state-file.
|
||||
$ENV{MUNIN_STATEFILE} = "$ENV{MUNIN_PLUGSTATE}/$service-$ENV{MUNIN_MASTER_IP}";
|
||||
@@ -243,7 +243,7 @@ sub exec_service
|
||||
|
||||
# XXX - Create the statedir for the user
|
||||
my $uid = $self->_resolve_uid($service);
|
||||
- Munin::Node::OS->mkdir_subdir("$Munin::Common::Defaults::MUNIN_PLUGSTATE", $uid);
|
||||
+ Munin::Node::OS->mkdir_subdir("$ENV{MUNIN_PLUGSTATE}", $uid);
|
||||
|
||||
$self->change_real_and_effective_user_and_group($service);
|
||||
|
||||
43
pkgs/servers/monitoring/nagios/default.nix
Normal file
43
pkgs/servers/monitoring/nagios/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ lib, stdenv, fetchurl, perl, php, gd, libpng, zlib, unzip, nixosTests }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "nagios";
|
||||
version = "4.4.6";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/nagios/nagios-4.x/${pname}-${version}/${pname}-${version}.tar.gz";
|
||||
sha256 = "1x5hb97zbvkm73q53ydp1gwj8nnznm72q9c4rm6ny7phr995l3db";
|
||||
};
|
||||
|
||||
patches = [ ./nagios.patch ];
|
||||
nativeBuildInputs = [ unzip ];
|
||||
buildInputs = [ php perl gd libpng zlib ];
|
||||
|
||||
configureFlags = [ "--localstatedir=/var/lib/nagios" ];
|
||||
buildFlags = [ "all" ];
|
||||
CFLAGS = "-ldl";
|
||||
|
||||
# Do not create /var directories
|
||||
preInstall = ''
|
||||
substituteInPlace Makefile --replace '$(MAKE) install-basic' ""
|
||||
'';
|
||||
installTargets = "install install-config";
|
||||
postInstall = ''
|
||||
# don't make default files use hardcoded paths to commands
|
||||
sed -i 's@command_line *[^ ]*/\([^/]*\) @command_line \1 @' $out/etc/objects/commands.cfg
|
||||
sed -i 's@/usr/bin/@@g' $out/etc/objects/commands.cfg
|
||||
sed -i 's@/bin/@@g' $out/etc/objects/commands.cfg
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) nagios;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A host, service and network monitoring program";
|
||||
homepage = "https://www.nagios.org/";
|
||||
license = lib.licenses.gpl2;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ immae thoughtpolice relrod ];
|
||||
};
|
||||
}
|
||||
23
pkgs/servers/monitoring/nagios/nagios.patch
Normal file
23
pkgs/servers/monitoring/nagios/nagios.patch
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
diff -ruN nagios-4.0.7.orig/configure nagios-4.0.7/configure
|
||||
--- nagios-4.0.7.orig/configure 2014-06-03 10:41:42.000000000 -0400
|
||||
+++ nagios-4.0.7/configure 2014-06-12 00:30:17.516468583 -0400
|
||||
@@ -6014,7 +6014,8 @@
|
||||
#define DEFAULT_NAGIOS_GROUP "$nagios_grp"
|
||||
_ACEOF
|
||||
|
||||
-INSTALL_OPTS="-o $nagios_user -g $nagios_grp"
|
||||
+#INSTALL_OPTS="-o $nagios_user -g $nagios_grp"
|
||||
+INSTALL_OPTS=""
|
||||
|
||||
|
||||
|
||||
@@ -6035,7 +6036,8 @@
|
||||
|
||||
|
||||
|
||||
-COMMAND_OPTS="-o $command_user -g $command_grp"
|
||||
+#COMMAND_OPTS="-o $command_user -g $command_grp"
|
||||
+COMMAND_OPTS=""
|
||||
|
||||
|
||||
MAIL_PROG=no
|
||||
43
pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix
Normal file
43
pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, file
|
||||
, openssl
|
||||
, makeWrapper
|
||||
, which
|
||||
, curl
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "check_ssl_cert";
|
||||
version = "2.27.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "matteocorti";
|
||||
repo = "check_ssl_cert";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-R70disK654wKbrrs5QKy1reNDnjZgkXTlR/dAhikI6s=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
makeFlags = [
|
||||
"DESTDIR=$(out)/bin"
|
||||
"MANDIR=$(out)/share/man"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/check_ssl_cert \
|
||||
--prefix PATH : "${lib.makeBinPath [ openssl file which curl ]}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Nagios plugin to check the CA and validity of an X.509 certificate";
|
||||
homepage = "https://github.com/matteocorti/check_ssl_cert";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
37
pkgs/servers/monitoring/nagios/plugins/check_systemd.nix
Normal file
37
pkgs/servers/monitoring/nagios/plugins/check_systemd.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ fetchFromGitHub, python3Packages, lib }:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "check_systemd";
|
||||
version = "2.3.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Josef-Friedrich";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "11sc0gycxzq1vfvin501jnwnky2ky6ns64yjiw8vq9vmkbf8nni6";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ nagiosplugin ];
|
||||
|
||||
postInstall = ''
|
||||
# check_systemd is only a broken stub calling check_systemd.py
|
||||
mv $out/bin/check_systemd{.py,}
|
||||
'';
|
||||
|
||||
# the test scripts run ./check_systemd.py and check_systemd. Patch to
|
||||
# the installed, patchShebanged executable in $out/bin
|
||||
preCheck = ''
|
||||
find test -name "*.py" -execdir sed -i "s@./check_systemd.py@$out/bin/check_systemd@" '{}' ";"
|
||||
export PATH=$PATH:$out/bin
|
||||
'';
|
||||
checkInputs = [ python3Packages.pytestCheckHook ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Nagios / Icinga monitoring plugin to check systemd for failed units";
|
||||
inherit (src.meta) homepage;
|
||||
changelog = "https://github.com/Josef-Friedrich/check_systemd/releases";
|
||||
maintainers = with maintainers; [ symphorien ];
|
||||
license = licenses.lgpl2Only;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
71
pkgs/servers/monitoring/net-snmp/default.nix
Normal file
71
pkgs/servers/monitoring/net-snmp/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, removeReferencesTo
|
||||
, file, openssl, perl, perlPackages, nettools
|
||||
, withPerlTools ? false }: let
|
||||
|
||||
perlWithPkgs = perl.withPackages (ps: with ps; [
|
||||
JSON
|
||||
TermReadKey
|
||||
Tk
|
||||
]);
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "net-snmp";
|
||||
version = "5.9.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/net-snmp/${pname}-${version}.tar.gz";
|
||||
sha256 = "sha256-63/UpE3mzdv/2akqha0TCeXBBU+51afdkweciVP0jD8=";
|
||||
};
|
||||
|
||||
patches =
|
||||
let fetchAlpinePatch = name: sha256: fetchpatch {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/net-snmp/${name}?id=f25d3fb08341b60b6ccef424399f060dfcf3f1a5";
|
||||
inherit name sha256;
|
||||
};
|
||||
in [
|
||||
(fetchAlpinePatch "fix-includes.patch" "0zpkbb6k366qpq4dax5wknwprhwnhighcp402mlm7950d39zfa3m")
|
||||
(fetchAlpinePatch "netsnmp-swinst-crash.patch" "0gh164wy6zfiwiszh58fsvr25k0ns14r3099664qykgpmickkqid")
|
||||
];
|
||||
|
||||
outputs = [ "bin" "out" "dev" "lib" ];
|
||||
|
||||
configureFlags =
|
||||
[ "--with-default-snmp-version=3"
|
||||
"--with-sys-location=Unknown"
|
||||
"--with-sys-contact=root@unknown"
|
||||
"--with-logfile=/var/log/net-snmpd.log"
|
||||
"--with-persistent-directory=/var/lib/net-snmp"
|
||||
"--with-openssl=${openssl.dev}"
|
||||
"--disable-embedded-perl"
|
||||
"--without-perl-modules"
|
||||
] ++ lib.optional stdenv.isLinux "--with-mnttab=/proc/mounts";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace testing/fulltests/support/simple_TESTCONF.sh --replace "/bin/netstat" "${nettools}/bin/netstat"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook nettools removeReferencesTo file ];
|
||||
buildInputs = [ openssl ]
|
||||
++ lib.optional withPerlTools perlWithPkgs;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
doCheck = false; # tries to use networking
|
||||
|
||||
postInstall = ''
|
||||
for f in "$lib/lib/"*.la $bin/bin/net-snmp-config $bin/bin/net-snmp-create-v3-user; do
|
||||
sed 's|-L${openssl.dev}|-L${lib.getLib openssl}|g' -i $f
|
||||
done
|
||||
mkdir $dev/bin
|
||||
mv $bin/bin/net-snmp-config $dev/bin
|
||||
# libraries contain configure options
|
||||
find $lib/lib -type f -exec remove-references-to -t $bin '{}' +
|
||||
find $lib/lib -type f -exec remove-references-to -t $dev '{}' +
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Clients and server for the SNMP network monitoring protocol";
|
||||
homepage = "http://www.net-snmp.org/";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
26
pkgs/servers/monitoring/newrelic-sysmond/default.nix
Normal file
26
pkgs/servers/monitoring/newrelic-sysmond/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "newrelic-sysmond";
|
||||
version = "2.3.0.132";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.newrelic.com/server_monitor/archive/${version}/newrelic-sysmond-${version}-linux.tar.gz";
|
||||
sha256 = "0cdvffdsadfahfn1779zjfawz6l77awab3g9mw43vsba1568jh4f";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
install -v -m755 daemon/nrsysmond.x64 $out/bin/nrsysmond
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
$out/bin/nrsysmond
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "System-wide monitoring for newrelic";
|
||||
homepage = "https://newrelic.com/";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ lnl7 ];
|
||||
};
|
||||
}
|
||||
120
pkgs/servers/monitoring/plugins/default.nix
Normal file
120
pkgs/servers/monitoring/plugins/default.nix
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeShellScript
|
||||
, autoreconfHook
|
||||
, pkg-config
|
||||
, runCommand
|
||||
, coreutils
|
||||
, gnugrep
|
||||
, gnused
|
||||
, lm_sensors
|
||||
, net-snmp
|
||||
, openssh
|
||||
, openssl
|
||||
, perl
|
||||
, dnsutils
|
||||
, libdbi
|
||||
, libmysqlclient
|
||||
, uriparser
|
||||
, zlib
|
||||
, openldap
|
||||
, procps
|
||||
, runtimeShell
|
||||
}:
|
||||
|
||||
let
|
||||
binPath = lib.makeBinPath [
|
||||
(placeholder "out")
|
||||
"/run/wrappers"
|
||||
coreutils
|
||||
gnugrep
|
||||
gnused
|
||||
lm_sensors
|
||||
net-snmp
|
||||
procps
|
||||
];
|
||||
|
||||
mailq = runCommand "mailq-wrapper" { preferLocalBuild = true; } ''
|
||||
mkdir -p $out/bin
|
||||
ln -s /run/wrappers/bin/sendmail $out/bin/mailq
|
||||
'';
|
||||
|
||||
# For unknown reasons the installer tries executing $out/share and fails so
|
||||
# we create it and remove it again later.
|
||||
share = writeShellScript "share" ''
|
||||
exit 0
|
||||
'';
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "monitoring-plugins";
|
||||
version = "2.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "monitoring-plugins";
|
||||
repo = "monitoring-plugins";
|
||||
rev = "v" + lib.versions.majorMinor version;
|
||||
sha256 = "sha256-yLhHOSrPFRjW701aOL8LPe4OnuJxL6f+dTxNqm0evIg=";
|
||||
};
|
||||
|
||||
# TODO: Awful hack. Grrr... this of course only works on NixOS.
|
||||
# Anyway the check that configure performs to figure out the ping
|
||||
# syntax is totally impure, because it runs an actual ping to
|
||||
# localhost (which won't work for ping6 if IPv6 support isn't
|
||||
# configured on the build machine).
|
||||
#
|
||||
# --with-ping-command needs to be done here instead of in
|
||||
# configureFlags due to the spaces in the argument
|
||||
postPatch = ''
|
||||
substituteInPlace po/Makefile.in.in \
|
||||
--replace /bin/sh ${runtimeShell}
|
||||
|
||||
sed -i configure.ac \
|
||||
-e 's|^DEFAULT_PATH=.*|DEFAULT_PATH=\"${binPath}\"|'
|
||||
|
||||
configureFlagsArray+=(
|
||||
--with-ping-command='/run/wrappers/bin/ping -4 -n -U -w %d -c %d %s'
|
||||
--with-ping6-command='/run/wrappers/bin/ping -6 -n -U -w %d -c %d %s'
|
||||
)
|
||||
|
||||
install -Dm555 ${share} $out/share
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--libexecdir=${placeholder "out"}/bin"
|
||||
"--with-mailq-command=${mailq}/bin/mailq"
|
||||
"--with-sudo-command=/run/wrappers/bin/sudo"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
dnsutils
|
||||
libdbi
|
||||
libmysqlclient
|
||||
net-snmp
|
||||
openldap
|
||||
# TODO: make openssh a runtime dependency only
|
||||
openssh
|
||||
openssl
|
||||
perl
|
||||
procps
|
||||
uriparser
|
||||
zlib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
rm $out/share
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Official monitoring plugins for Nagios/Icinga/Sensu and others";
|
||||
homepage = "https://www.monitoring-plugins.org";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ thoughtpolice relrod ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
36
pkgs/servers/monitoring/plugins/esxi.nix
Normal file
36
pkgs/servers/monitoring/plugins/esxi.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, fetchFromGitHub, python3Packages }:
|
||||
|
||||
let
|
||||
bName = "check_esxi_hardware";
|
||||
|
||||
in python3Packages.buildPythonApplication rec {
|
||||
pname = lib.replaceStrings [ "_" ] [ "-" ] bName;
|
||||
version = "20200710";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Napsty";
|
||||
repo = bName;
|
||||
rev = version;
|
||||
sha256 = "EC6np/01S+5SA2H9z5psJ9Pq/YoEyGdHL9wHUKKsNas=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
doCheck = false;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 ${bName}.py $out/bin/${bName}
|
||||
install -Dm644 -t $out/share/doc/${pname} README.md
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ pywbem requests setuptools ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.claudiokuenzler.com/nagios-plugins/";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
77
pkgs/servers/monitoring/plugins/labs_consol_de.nix
Normal file
77
pkgs/servers/monitoring/plugins/labs_consol_de.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ lib, stdenv, fetchFromGitHub, fetchurl, autoreconfHook, makeWrapper
|
||||
, perlPackages, coreutils, gnused, gnugrep }:
|
||||
|
||||
let
|
||||
glplugin = fetchFromGitHub {
|
||||
owner = "lausser";
|
||||
repo = "GLPlugin";
|
||||
rev = "ef3107f01afe55fad5452e64ac5bbea00b18a8d5";
|
||||
sha256 = "047fwrycsl2vmpi4wl46fs6f8y191d6qc9ms5rvmrj1dm2r828ws";
|
||||
};
|
||||
|
||||
generic = { pname, version, sha256, description, buildInputs, ... }:
|
||||
stdenv.mkDerivation {
|
||||
inherit pname version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://labs.consol.de/assets/downloads/nagios/${pname}-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
buildInputs = [ perlPackages.perl ] ++ buildInputs;
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
||||
|
||||
prePatch = with lib; ''
|
||||
rm -rf GLPlugin
|
||||
ln -s ${glplugin} GLPlugin
|
||||
substituteInPlace plugins-scripts/Makefile.am \
|
||||
--replace /bin/cat ${getBin coreutils}/bin/cat \
|
||||
--replace /bin/echo ${getBin coreutils}/bin/echo \
|
||||
--replace /bin/grep ${getBin gnugrep}/bin/grep \
|
||||
--replace /bin/sed ${getBin gnused}/bin/sed
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
test -d $out/libexec && ln -sr $out/libexec $out/bin
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
for f in $out/bin/* ; do
|
||||
wrapProgram $f --prefix PERL5LIB : $PERL5LIB
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://labs.consol.de/";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
inherit description;
|
||||
};
|
||||
};
|
||||
|
||||
in {
|
||||
check-mssql-health = generic {
|
||||
pname = "check_mssql_health";
|
||||
version = "2.6.4.15";
|
||||
sha256 = "12z0b3c2p18viy7s93r6bbl8fvgsqh80136d07118qhxshp1pwxg";
|
||||
description = "Check plugin for Microsoft SQL Server";
|
||||
buildInputs = [ perlPackages.DBDsybase ];
|
||||
};
|
||||
|
||||
check-nwc-health = generic {
|
||||
pname = "check_nwc_health";
|
||||
version = "7.10.0.6";
|
||||
sha256 = "092rhaqnk3403z0y60x38vgh65gcia3wrd6gp8mr7wszja38kxv2";
|
||||
description = "Check plugin for network equipment";
|
||||
buildInputs = [ perlPackages.NetSNMP ];
|
||||
};
|
||||
|
||||
check-ups-health = generic {
|
||||
pname = "check_ups_health";
|
||||
version = "2.8.3.3";
|
||||
sha256 = "0qc2aglppwr9ms4p53kh9nr48625sqrbn46xs0k9rx5sv8hil9hm";
|
||||
description = "Check plugin for UPSs";
|
||||
buildInputs = [ perlPackages.NetSNMP ];
|
||||
};
|
||||
}
|
||||
22
pkgs/servers/monitoring/plugins/openvpn.nix
Normal file
22
pkgs/servers/monitoring/plugins/openvpn.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, fetchFromGitHub, python3Packages }:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "check-openvpn";
|
||||
version = "0.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "liquidat";
|
||||
repo = "nagios-icinga-openvpn";
|
||||
rev = version;
|
||||
sha256 = "1vz3p7nckc5k5f06nm1xfzpykhyndh2dzyagmifrzg5k478p1lpm";
|
||||
};
|
||||
|
||||
# no tests
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A nagios/icinga/sensu check plugin for OpenVPN";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
26
pkgs/servers/monitoring/plugins/uptime.nix
Normal file
26
pkgs/servers/monitoring/plugins/uptime.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "check-uptime";
|
||||
version = "20161112";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "madrisan";
|
||||
repo = "nagios-plugins-uptime";
|
||||
rev = "51822dacd1d404b3eabf3b4984c64b2475ed6f3b";
|
||||
sha256 = "18q9ibzqn97dsyr9xs3w9mqk80nmmfw3kcjidrdsj542amlsycyk";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = "ln -sr $out/libexec $out/bin";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Uptime check plugin for Sensu/Nagios/others";
|
||||
homepage = "https://github.com/madrisan/nagios-plugins-uptime";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
46
pkgs/servers/monitoring/plugins/wmic-bin.nix
Normal file
46
pkgs/servers/monitoring/plugins/wmic-bin.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ stdenv, lib, fetchFromGitHub, autoPatchelfHook, popt }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "wmic-bin";
|
||||
version = "0.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "R-Vision";
|
||||
repo = "wmi-client";
|
||||
rev = version;
|
||||
sha256 = "1w1mdbiwz37wzry1q38h8dyjaa6iggmsb9wcyhhlawwm1vj50w48";
|
||||
};
|
||||
|
||||
buildInputs = [ popt ];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
doInstallCheck = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 bin/wmic_ubuntu_x64 $out/bin/wmic
|
||||
install -Dm644 -t $out/share/doc/wmic LICENSE README.md
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
$out/bin/wmic --help >/dev/null
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "WMI client for Linux (binary)";
|
||||
homepage = "https://www.openvas.org";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
77
pkgs/servers/monitoring/plugins/wmiplus/default.nix
Normal file
77
pkgs/servers/monitoring/plugins/wmiplus/default.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages, txt2man
|
||||
, monitoring-plugins
|
||||
, wmic-bin ? null }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "check-wmiplus";
|
||||
version = "1.65";
|
||||
|
||||
# We fetch from github.com instead of the proper upstream as nix-build errors
|
||||
# out with 406 when trying to fetch the sources
|
||||
src = fetchFromGitHub {
|
||||
owner = "speartail";
|
||||
repo = "checkwmiplus";
|
||||
rev = "v${version}";
|
||||
sha256 = "1as0iyhy4flpm37mb7lvah7rnd6ax88appjm1icwhy7iq03wi8pl";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./wmiplus_fix_manpage.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with perlPackages; [
|
||||
BHooksEndOfScope ClassDataInheritable ClassInspector ClassSingleton
|
||||
ConfigIniFiles DateTime DateTimeLocale DateTimeTimeZone DevelStackTrace
|
||||
EvalClosure ExceptionClass FileShareDir ModuleImplementation ModuleRuntime
|
||||
MROCompat namespaceautoclean namespaceclean NumberFormat PackageStash
|
||||
ParamsValidate ParamsValidationCompiler RoleTiny Specio
|
||||
SubExporterProgressive SubIdentify TryTiny
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper txt2man ];
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
doCheck = false; # no checks
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace check_wmi_plus.pl \
|
||||
--replace /usr/bin/wmic ${wmic-bin}/bin/wmic \
|
||||
--replace /etc/check_wmi_plus $out/etc/check_wmi_plus \
|
||||
--replace /opt/nagios/bin/plugins $out/etc/check_wmi_plus \
|
||||
--replace /usr/lib/nagios/plugins ${monitoring-plugins}/libexec \
|
||||
--replace '$base_dir/check_wmi_plus_help.pl' "$out/bin/check_wmi_plus_help.pl"
|
||||
|
||||
for f in *.pl ; do
|
||||
substituteInPlace $f --replace /usr/bin/perl ${perlPackages.perl}/bin/perl
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 -t $out/bin *.pl
|
||||
install -Dm644 -t $out/share/doc/${pname} *.txt
|
||||
cp -r etc $out/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# 1. we need to wait until the main binary has been fixed up with proper perl paths before we can run it to generate the man page
|
||||
# 2. txt2man returns exit code 3 even if it works, so we add the || true bit
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/check_wmi_plus.pl \
|
||||
--set PERL5LIB "${perlPackages.makePerlPath propagatedBuildInputs}"
|
||||
|
||||
mkdir -p $out/share/man/man1
|
||||
$out/bin/check_wmi_plus.pl --help | txt2man -d 1970-01-01 -s 1 -t check_wmi_plus -r "Check WMI Plus ${version}" > $out/share/man/man1/check_wmi_plus.1 || true
|
||||
gzip $out/share/man/man1/check_wmi_plus.1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A sensu/nagios plugin using WMI to query Windows hosts";
|
||||
homepage = "http://edcint.co.nz/checkwmiplus";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
diff --git a/check_wmi_plus.makeman.sh b/check_wmi_plus.makeman.sh
|
||||
index 38dc7a4..3fe4369 100755
|
||||
--- a/check_wmi_plus.makeman.sh
|
||||
+++ b/check_wmi_plus.makeman.sh
|
||||
@@ -19,15 +19,6 @@ mkdir -p "$manpage_dir/man1"
|
||||
# the full path to the manpage file
|
||||
manfile="$manpage_dir/man1/check_wmi_plus.1"
|
||||
|
||||
-# if we are not running in a terminal then only show the text-based help
|
||||
-if [ ! -t 0 ]; then
|
||||
- # we are not running in a terminal
|
||||
- echo "Not running in a terminal - showing text-based help"
|
||||
- echo
|
||||
- exec $check_wmi_plus_text_help
|
||||
-fi
|
||||
-
|
||||
-
|
||||
usage()
|
||||
{
|
||||
cat << EOT
|
||||
diff --git a/check_wmi_plus_help.pl b/check_wmi_plus_help.pl
|
||||
index 3440db2..2982da2 100755
|
||||
--- a/check_wmi_plus_help.pl
|
||||
+++ b/check_wmi_plus_help.pl
|
||||
@@ -24,7 +24,7 @@ if ($opt_help) {
|
||||
# we have the script to make the manpage and have not been asked to show text only help
|
||||
exec ("$make_manpage_script \"$0 --itexthelp\" \"$manpage_dir\"") or print STDERR "couldn't exec $make_manpage_script: $!";
|
||||
} else {
|
||||
- print "Warning: Can not access/execute Manpage script ($make_manpage_script).\nShowing help in text-only format.\n\n";
|
||||
+ # print "Warning: Can not access/execute Manpage script ($make_manpage_script).\nShowing help in text-only format.\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,4 +692,4 @@ show_ini_help_overview(1);
|
||||
finish_program($ERRORS{'UNKNOWN'});
|
||||
}
|
||||
|
||||
-1;
|
||||
\ No newline at end of file
|
||||
+1;
|
||||
44
pkgs/servers/monitoring/prometheus/alertmanager.nix
Normal file
44
pkgs/servers/monitoring/prometheus/alertmanager.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "alertmanager";
|
||||
version = "0.24.0";
|
||||
rev = "v${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "prometheus";
|
||||
repo = "alertmanager";
|
||||
sha256 = "sha256-hoCE0wD9/Sh/oBce7kCg/wG44FmMs6dAKnEYP+2sH0w=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-ePb9qdCTEHHIV6JlbrBlaZjD5APwQuoGloO88W5S7Oc=";
|
||||
|
||||
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
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Alert dispatcher for the Prometheus monitoring system";
|
||||
homepage = "https://github.com/prometheus/alertmanager";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
24
pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix
Normal file
24
pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ 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=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-bvLwHLviIAGmxYY1O0wFDWAMginEUklicrbjIbbPuUw=";
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) apcupsd; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Provides a Prometheus exporter for the apcupsd Network Information Server (NIS)";
|
||||
homepage = "https://github.com/mdlayher/apcupsd_exporter";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ _1000101 mdlayher ];
|
||||
};
|
||||
}
|
||||
35
pkgs/servers/monitoring/prometheus/artifactory-exporter.nix
Normal file
35
pkgs/servers/monitoring/prometheus/artifactory-exporter.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "artifactory_exporter";
|
||||
version = "1.9.1";
|
||||
rev = "v${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "peimanja";
|
||||
repo = pname;
|
||||
rev = rev;
|
||||
sha256 = "1m68isplrs3zvkg0mans9bgablsif6264x3w475bpnhf68r87v1q";
|
||||
};
|
||||
|
||||
vendorSha256 = "0acwgb0h89parkx75jp057m2hrqyd95vr2zcfqnxbnyy98gxip73";
|
||||
|
||||
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";
|
||||
homepage = "https://github.com/peimanja/artifactory_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ lbpdt ];
|
||||
};
|
||||
}
|
||||
24
pkgs/servers/monitoring/prometheus/aws-s3-exporter.nix
Normal file
24
pkgs/servers/monitoring/prometheus/aws-s3-exporter.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ 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=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Exports Prometheus metrics about S3 buckets and objects";
|
||||
homepage = "https://github.com/ribbybibby/s3_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = [ maintainers.mmahut ];
|
||||
};
|
||||
}
|
||||
25
pkgs/servers/monitoring/prometheus/bind-exporter.nix
Normal file
25
pkgs/servers/monitoring/prometheus/bind-exporter.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "bind_exporter";
|
||||
version = "0.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "prometheus-community";
|
||||
repo = "bind_exporter";
|
||||
sha256 = "sha256-ta+uy0FUEMcL4SW1K3v2j2bfDRmdAIz42MKPsNj4FbA=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-L0jZM83u423tiLf7kcqnXsQi7QBvNEXhuU+IwXXAhE0=";
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) bind; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus exporter for bind9 server";
|
||||
homepage = "https://github.com/digitalocean/bind_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ rtreffer ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
24
pkgs/servers/monitoring/prometheus/bird-exporter.nix
Normal file
24
pkgs/servers/monitoring/prometheus/bird-exporter.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "bird-exporter";
|
||||
version = "1.4.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "czerwonk";
|
||||
repo = "bird_exporter";
|
||||
rev = version;
|
||||
sha256 = "sha256-QCnOMiAcvn0HcppGJlf3sdllApKcjHpucvk9xxD/MqE=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-jBwaneVv1a8iIqnhDbQOnvaJdnXgO8P90Iv51IfGaM0=";
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) bird; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus exporter for the bird routing daemon";
|
||||
homepage = "https://github.com/czerwonk/bird_exporter";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ lukegb ];
|
||||
};
|
||||
}
|
||||
42
pkgs/servers/monitoring/prometheus/bitcoin-exporter.nix
Normal file
42
pkgs/servers/monitoring/prometheus/bitcoin-exporter.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ lib, fetchFromGitHub, fetchpatch, python3Packages }:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "bitcoin-prometheus-exporter";
|
||||
version = "0.5.0";
|
||||
|
||||
format = "other";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jvstein";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0l0j6dyb0vflh386z3g8srysay5sf47g5rg2f5xrkckv86rjr115";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# remove after update to new release
|
||||
(fetchpatch {
|
||||
name = "configurable-listening-address.patch";
|
||||
url = "https://patch-diff.githubusercontent.com/raw/jvstein/bitcoin-prometheus-exporter/pull/11.patch";
|
||||
sha256 = "0a2l8aqgprc1d5k8yg1gisn6imh9hzg6j0irid3pjvp5i5dcnhyq";
|
||||
})
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ prometheus-client 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";
|
||||
homepage = "https://github.com/jvstein/bitcoin-prometheus-exporter";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ mmilata ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
39
pkgs/servers/monitoring/prometheus/blackbox-exporter.nix
Normal file
39
pkgs/servers/monitoring/prometheus/blackbox-exporter.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "blackbox_exporter";
|
||||
version = "0.20.0";
|
||||
rev = "v${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "prometheus";
|
||||
repo = "blackbox_exporter";
|
||||
sha256 = "sha256-Y3HdFIChkQVooxy2I2Gbqw3WLHsI4Zm+osHTzFluRZA=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-KFLR0In4txQQp5dt8P0yAFtf82b4SBq2xMnlz+vMuuU=";
|
||||
|
||||
# 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";
|
||||
homepage = "https://github.com/prometheus/blackbox_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ globin fpletz willibutz Frostman ma27 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
26
pkgs/servers/monitoring/prometheus/collectd-exporter.nix
Normal file
26
pkgs/servers/monitoring/prometheus/collectd-exporter.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildGoPackage, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "collectd-exporter";
|
||||
version = "0.5.0";
|
||||
rev = version;
|
||||
|
||||
goPackagePath = "github.com/prometheus/collectd_exporter";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "prometheus";
|
||||
repo = "collectd_exporter";
|
||||
sha256 = "0vb6vnd2j87iqxdl86j30dk65vrv4scprv200xb83203aprngqgh";
|
||||
};
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) collectd; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Relay server for exporting metrics from collectd to Prometheus";
|
||||
homepage = "https://github.com/prometheus/collectd_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ benley fpletz ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
25
pkgs/servers/monitoring/prometheus/consul-exporter.nix
Normal file
25
pkgs/servers/monitoring/prometheus/consul-exporter.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "consul_exporter";
|
||||
version = "0.8.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "prometheus";
|
||||
repo = "consul_exporter";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-5odAKMWK2tDZ3a+bIVIdPgzxrW64hF8nNqItGO7sODI=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-vbaiHeQRo9hsHa/10f4202xLe9mduELRJMCDFuyKlW0=";
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus exporter for Consul metrics";
|
||||
homepage = "https://github.com/prometheus/consul_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ hectorj ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
134
pkgs/servers/monitoring/prometheus/default.nix
Normal file
134
pkgs/servers/monitoring/prometheus/default.nix
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, go
|
||||
, pkgs
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, fetchurl
|
||||
, nixosTests
|
||||
, enableAWS ? true
|
||||
, enableAzure ? true
|
||||
, enableConsul ? true
|
||||
, enableDigitalOcean ? true
|
||||
, enableEureka ? true
|
||||
, enableGCE ? true
|
||||
, enableHetzner ? true
|
||||
, enableKubernetes ? true
|
||||
, enableLinode ? true
|
||||
, enableMarathon ? true
|
||||
, enableMoby ? true
|
||||
, enableOpenstack ? true
|
||||
, enablePuppetDB ? true
|
||||
, enableScaleway ? true
|
||||
, enableTriton ? true
|
||||
, enableUyuni ? true
|
||||
, enableXDS ? true
|
||||
, enableZookeeper ? true
|
||||
}:
|
||||
|
||||
let
|
||||
version = "2.35.0";
|
||||
webUiStatic = fetchurl {
|
||||
url = "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-web-ui-${version}.tar.gz";
|
||||
sha256 = "sha256-66zWOjFTYwmspiKeklt3NAAT1uJJrZqeyQvWWsCN9fQ=";
|
||||
};
|
||||
in
|
||||
buildGoModule rec {
|
||||
pname = "prometheus";
|
||||
inherit version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "prometheus";
|
||||
repo = "prometheus";
|
||||
sha256 = "sha256-h0uBs3xMKpRH3A1VG5xrhjXVAT7GL5L3UZWb3HJ2Fz4=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-0I6hmjhdfB41rWOQ9FM9CMq5w5437ka/jLuFXcBQBlM=";
|
||||
|
||||
excludedPackages = [ "documentation/prometheus-mixin" ];
|
||||
|
||||
postPatch = ''
|
||||
tar -C web/ui -xzf ${webUiStatic}
|
||||
|
||||
patchShebangs scripts
|
||||
|
||||
# Enable only select service discovery to shrink binaries.
|
||||
(
|
||||
true # prevent bash syntax error when all plugins are disabled
|
||||
${lib.optionalString (enableAWS)
|
||||
"echo - github.com/prometheus/prometheus/discovery/aws"}
|
||||
${lib.optionalString (enableAzure)
|
||||
"echo - github.com/prometheus/prometheus/discovery/azure"}
|
||||
${lib.optionalString (enableConsul)
|
||||
"echo - github.com/prometheus/prometheus/discovery/consul"}
|
||||
${lib.optionalString (enableDigitalOcean)
|
||||
"echo - github.com/prometheus/prometheus/discovery/digitalocean"}
|
||||
${lib.optionalString (enableEureka)
|
||||
"echo - github.com/prometheus/prometheus/discovery/eureka"}
|
||||
${lib.optionalString (enableGCE)
|
||||
"echo - github.com/prometheus/prometheus/discovery/gce"}
|
||||
${lib.optionalString (enableHetzner)
|
||||
"echo - github.com/prometheus/prometheus/discovery/hetzner"}
|
||||
${lib.optionalString (enableKubernetes)
|
||||
"echo - github.com/prometheus/prometheus/discovery/kubernetes"}
|
||||
${lib.optionalString (enableLinode)
|
||||
"echo - github.com/prometheus/prometheus/discovery/linode"}
|
||||
${lib.optionalString (enableMarathon)
|
||||
"echo - github.com/prometheus/prometheus/discovery/marathon"}
|
||||
${lib.optionalString (enableMoby)
|
||||
"echo - github.com/prometheus/prometheus/discovery/moby"}
|
||||
${lib.optionalString (enableOpenstack)
|
||||
"echo - github.com/prometheus/prometheus/discovery/openstack"}
|
||||
${lib.optionalString (enablePuppetDB)
|
||||
"echo - github.com/prometheus/prometheus/discovery/puppetdb"}
|
||||
${lib.optionalString (enableScaleway)
|
||||
"echo - github.com/prometheus/prometheus/discovery/scaleway"}
|
||||
${lib.optionalString (enableTriton)
|
||||
"echo - github.com/prometheus/prometheus/discovery/triton"}
|
||||
${lib.optionalString (enableUyuni)
|
||||
"echo - github.com/prometheus/prometheus/discovery/uyuni"}
|
||||
${lib.optionalString (enableXDS)
|
||||
"echo - github.com/prometheus/prometheus/discovery/xds"}
|
||||
${lib.optionalString (enableZookeeper)
|
||||
"echo - github.com/prometheus/prometheus/discovery/zookeeper"}
|
||||
) > plugins.yml
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
if [[ -d vendor ]]; then make -o assets assets-compress plugins; fi
|
||||
'';
|
||||
|
||||
tags = [ "builtinassets" ];
|
||||
|
||||
ldflags =
|
||||
let
|
||||
t = "github.com/prometheus/common/version";
|
||||
in
|
||||
[
|
||||
"-X ${t}.Version=${version}"
|
||||
"-X ${t}.Revision=unknown"
|
||||
"-X ${t}.Branch=unknown"
|
||||
"-X ${t}.BuildUser=nix@nixpkgs"
|
||||
"-X ${t}.BuildDate=unknown"
|
||||
"-X ${t}.GoVersion=${lib.getVersion go}"
|
||||
];
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p "$out/share/doc/prometheus" "$out/etc/prometheus"
|
||||
cp -a $src/documentation/* $out/share/doc/prometheus
|
||||
cp -a $src/console_libraries $src/consoles $out/etc/prometheus
|
||||
'';
|
||||
|
||||
doCheck = !stdenv.isDarwin; # https://hydra.nixos.org/build/130673870/nixlog/1
|
||||
|
||||
passthru.tests = { inherit (nixosTests) prometheus; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Service monitoring system and time series database";
|
||||
homepage = "https://prometheus.io";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ benley fpletz globin willibutz Frostman ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
{ lib
|
||||
, python3
|
||||
, fetchpatch
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "dmarc-metrics-exporter";
|
||||
version = "0.5.1";
|
||||
|
||||
disabled = python3.pythonOlder "3.7";
|
||||
|
||||
format = "pyproject";
|
||||
|
||||
src = python3.pkgs.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "22ec361f9a4c86abefbfab541f588597e21bf4fbedf2911f230e560b2ec3503a";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# https://github.com/jgosmann/dmarc-metrics-exporter/pull/23
|
||||
(fetchpatch {
|
||||
url = "https://github.com/jgosmann/dmarc-metrics-exporter/commit/3fe401f5dfb9e0304601a2a89ac987ff853b7cba.patch";
|
||||
hash = "sha256-MjVLlFQMp2r3AhBMu1lEmRm0Y2H9FdvCfPgAK5kvwWE=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace 'python = "^3.7,<3.10"' 'python = "^3.7,<3.11"' \
|
||||
--replace poetry.masonry.api poetry.core.masonry.api \
|
||||
--replace '"^' '">='
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with python3.pkgs; [
|
||||
poetry-core
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
bite-parser
|
||||
dataclasses-serialization
|
||||
prometheus-client
|
||||
typing-extensions
|
||||
uvicorn
|
||||
xsdata
|
||||
];
|
||||
|
||||
checkInputs = with python3.pkgs; [
|
||||
aiohttp
|
||||
pytest-asyncio
|
||||
pytestCheckHook
|
||||
requests
|
||||
];
|
||||
|
||||
disabledTestPaths = [
|
||||
# require networking
|
||||
"dmarc_metrics_exporter/tests/test_e2e.py"
|
||||
"dmarc_metrics_exporter/tests/test_imap_client.py"
|
||||
"dmarc_metrics_exporter/tests/test_imap_queue.py"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "dmarc_metrics_exporter" ];
|
||||
|
||||
meta = {
|
||||
description = "Export Prometheus metrics from DMARC reports";
|
||||
homepage = "https://github.com/jgosmann/dmarc-metrics-exporter";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ ma27 ];
|
||||
};
|
||||
}
|
||||
26
pkgs/servers/monitoring/prometheus/dnsmasq-exporter.nix
Normal file
26
pkgs/servers/monitoring/prometheus/dnsmasq-exporter.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "dnsmasq_exporter";
|
||||
version = "0.2.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "google";
|
||||
repo = "dnsmasq_exporter";
|
||||
sha256 = "1i7imid981l0a9k8lqyr9igm3qkk92kid4xzadkwry4857k6mgpj";
|
||||
rev = "v${version}";
|
||||
};
|
||||
|
||||
vendorSha256 = "1dqpa180pbdi2gcmp991d4cry560mx5rm5l9x065s9n9gnd38hvl";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) dnsmasq; };
|
||||
|
||||
meta = with lib; {
|
||||
inherit (src.meta) homepage;
|
||||
description = "A dnsmasq exporter for Prometheus";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ willibutz globin ma27 ];
|
||||
};
|
||||
}
|
||||
26
pkgs/servers/monitoring/prometheus/domain-exporter.nix
Normal file
26
pkgs/servers/monitoring/prometheus/domain-exporter.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "domain-exporter";
|
||||
version = "1.11.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "caarlos0";
|
||||
repo = "domain_exporter";
|
||||
rev = "v${version}";
|
||||
sha256 = "018y0xwdn2f2shhwaa0hqm4y8xsbqwif0733qb0377wpjbj4v137";
|
||||
};
|
||||
|
||||
vendorSha256 = "0s1hs8byba9y57abg386n09wfg1wcqpzs164ap0km8ap2i96bdlb";
|
||||
|
||||
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";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ mmilata prusnak ];
|
||||
};
|
||||
}
|
||||
102
pkgs/servers/monitoring/prometheus/dovecot-exporter-deps.nix
Normal file
102
pkgs/servers/monitoring/prometheus/dovecot-exporter-deps.nix
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
|
||||
[
|
||||
{
|
||||
goPackagePath = "github.com/alecthomas/template";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/alecthomas/template";
|
||||
rev = "a0175ee3bccc567396460bf5acd36800cb10c49c";
|
||||
sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/alecthomas/units";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/alecthomas/units";
|
||||
rev = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a";
|
||||
sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/beorn7/perks";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/beorn7/perks";
|
||||
rev = "3a771d992973f24aa725d07868b467d1ddfceafb";
|
||||
sha256 = "1l2lns4f5jabp61201sh88zf3b0q793w4zdgp9nll7mmfcxxjif3";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/gogo/protobuf";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/gogo/protobuf";
|
||||
rev = "4aa4cc277ae58d2fab6cfe51dd17df5dceaf457d";
|
||||
sha256 = "009z6rpivyakgsxs0zkm94c9i7l65hcw2ljvah94wq3y6v6j47gs";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/golang/protobuf";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/golang/protobuf";
|
||||
rev = "0f2620f554cf5c8e281a2eb655a035f5a0f6dc90";
|
||||
sha256 = "0lxngq1a8cnsy6dlr6gi8pjv3fir2wiw76qh075pa9g02h7ywhv3";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/matttproud/golang_protobuf_extensions";
|
||||
rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c";
|
||||
sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/client_golang";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/client_golang";
|
||||
rev = "b5bfa0eb2c8d46bd91dc58271e973c5f0bbebcfa";
|
||||
sha256 = "1msxzkdgi0ing4ddmp0s4qrf267n6ylafw9mbz5yrr7spb1dgxgk";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/client_model";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/client_model";
|
||||
rev = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f";
|
||||
sha256 = "04psf81l9fjcwascsys428v03fx4fi894h7fhrj2vvcz723q57k0";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/common";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/common";
|
||||
rev = "c7de2306084e37d54b8be01f3541a8464345e9a5";
|
||||
sha256 = "11dqfm2d0m4sjjgyrnayman96g59x2apmvvqby9qmww2qj2k83ig";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/procfs";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/procfs";
|
||||
rev = "05ee40e3a273f7245e8777337fc7b46e533a9a92";
|
||||
sha256 = "0f6fnczxa42b9rys2h3l0m8fy3x5hrhaq707vq0lbx5fcylw8lis";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "gopkg.in/alecthomas/kingpin.v2";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://gopkg.in/alecthomas/kingpin.v2";
|
||||
rev = "947dcec5ba9c011838740e680966fd7087a71d0d";
|
||||
sha256 = "0mndnv3hdngr3bxp7yxfd47cas4prv98sqw534mx7vp38gd88n5r";
|
||||
};
|
||||
}
|
||||
]
|
||||
26
pkgs/servers/monitoring/prometheus/dovecot-exporter.nix
Normal file
26
pkgs/servers/monitoring/prometheus/dovecot-exporter.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildGoPackage, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "dovecot_exporter";
|
||||
version = "0.1.3";
|
||||
|
||||
goPackagePath = "github.com/kumina/dovecot_exporter";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kumina";
|
||||
repo = "dovecot_exporter";
|
||||
rev = version;
|
||||
sha256 = "1lnxnnm45fhcyv40arcvpiiibwdnxdwhkf8sbjpifx1wspvphcj9";
|
||||
};
|
||||
|
||||
goDeps = ./dovecot-exporter-deps.nix;
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) dovecot; };
|
||||
|
||||
meta = with lib; {
|
||||
inherit (src.meta) homepage;
|
||||
description = "Prometheus metrics exporter for Dovecot";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ willibutz globin ];
|
||||
};
|
||||
}
|
||||
22
pkgs/servers/monitoring/prometheus/fastly-exporter.nix
Normal file
22
pkgs/servers/monitoring/prometheus/fastly-exporter.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "fastly-exporter";
|
||||
version = "7.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "peterbourgon";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-KL+UfYuHtfQ9sKad7Q1KqIK4CFzDsIWvgG1YO1ZbUQc=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-yE7yvnyDfrrFdBmBBYe2gBU7b4gOWl5kfqkoblE51EQ=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus exporter for the Fastly Real-time Analytics API";
|
||||
homepage = "https://github.com/peterbourgon/fastly-exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = teams.deshaw.members;
|
||||
};
|
||||
}
|
||||
23
pkgs/servers/monitoring/prometheus/flow-exporter.nix
Normal file
23
pkgs/servers/monitoring/prometheus/flow-exporter.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ 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=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-2raOUOPiMUMydIsfSsnwUAAiM7WyMio1NgL1EoADr2s=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Export network flows from kafka to Prometheus";
|
||||
homepage = "https://github.com/neptune-networks/flow-exporter";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ kloenk ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
27
pkgs/servers/monitoring/prometheus/fritzbox-exporter.nix
Normal file
27
pkgs/servers/monitoring/prometheus/fritzbox-exporter.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "fritzbox-exporter";
|
||||
version = "unstable-2021-04-13";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "fd36539bd7db191b3734e17934b5f1e78e4e9829";
|
||||
owner = "mxschmitt";
|
||||
repo = "fritzbox_exporter";
|
||||
sha256 = "0w9gdcnfc61q6mzm95i7kphsf1rngn8rb6kz1b6knrh5d8w61p1n";
|
||||
};
|
||||
|
||||
subPackages = [ "cmd/exporter" ];
|
||||
|
||||
vendorSha256 = "0k6bd052pjfg5c1ba1yhni8msv3wl512vfzy2hrk49jibh8h052n";
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) fritzbox; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus Exporter for FRITZ!Box (TR64 and UPnP)";
|
||||
homepage = "https://github.com/mxschmitt/fritzbox_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ bachp flokli sbruder ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "gitlab-ci-pipelines-exporter";
|
||||
version = "0.5.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mvisonneau";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1i0ry93w2pk8m7i4fbdn1xvsmvjn83d6lr6l7yywid9d0kmkjz13";
|
||||
};
|
||||
|
||||
subPackages = [ "cmd/${pname}" ];
|
||||
|
||||
ldflags = [
|
||||
"-X main.version=v${version}"
|
||||
];
|
||||
|
||||
vendorSha256 = "UszZaxql5sO4DSDVD/UIjeeDojCQEPF+ATL7O9MaTG8=";
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus / OpenMetrics exporter for GitLab CI pipelines insights";
|
||||
homepage = "https://github.com/mvisonneau/gitlab-ci-pipelines-exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ mmahut mvisonneau ];
|
||||
};
|
||||
}
|
||||
25
pkgs/servers/monitoring/prometheus/haproxy-exporter.nix
Normal file
25
pkgs/servers/monitoring/prometheus/haproxy-exporter.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "haproxy_exporter";
|
||||
version = "0.13.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "prometheus";
|
||||
repo = "haproxy_exporter";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-F0yYUIKTIGyhzL0QwmioQYnWBb0GeFOhBwL3IqDKoQA=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-iJ2doxsLqTitsKJg3PUFLzEtLlP5QckSdFZkXX3ALIE=";
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "HAProxy Exporter for the Prometheus monitoring system";
|
||||
homepage = "https://github.com/prometheus/haproxy_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ benley fpletz ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
35
pkgs/servers/monitoring/prometheus/influxdb-exporter.nix
Normal file
35
pkgs/servers/monitoring/prometheus/influxdb-exporter.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "influxdb_exporter";
|
||||
version = "0.8.0";
|
||||
rev = "v${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "prometheus";
|
||||
repo = "influxdb_exporter";
|
||||
sha256 = "sha256-aNj4ru3yDet+jdcEpckFVaymmjWmKzTMPcTxPMNFbgo=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
||||
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";
|
||||
homepage = "https://github.com/prometheus/influxdb_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
23
pkgs/servers/monitoring/prometheus/jitsi-exporter.nix
Normal file
23
pkgs/servers/monitoring/prometheus/jitsi-exporter.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ 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";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) jitsi; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Export Jitsi Videobridge metrics to Prometheus";
|
||||
homepage = "https://git.xsfx.dev/prometheus/jitsiexporter";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ petabyteboy ];
|
||||
};
|
||||
}
|
||||
34
pkgs/servers/monitoring/prometheus/jmx-httpserver.nix
Normal file
34
pkgs/servers/monitoring/prometheus/jmx-httpserver.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ 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 = "A process for exposing JMX Beans via HTTP for Prometheus consumption";
|
||||
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
||||
license = licenses.asl20;
|
||||
maintainers = [ maintainers.offline ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
25
pkgs/servers/monitoring/prometheus/json-exporter.nix
Normal file
25
pkgs/servers/monitoring/prometheus/json-exporter.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "prometheus-json-exporter";
|
||||
version = "0.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "prometheus-community";
|
||||
repo = "json_exporter";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-BzzDa+5YIyaqG88AZumGVEbbHomcNWhVWhSrITdD6XA=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-Xw5xsEwd+v2f4DBsjY4q0tzABgNo4NuEtiTMoZ/pFNE=";
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) json; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "A prometheus exporter which scrapes remote JSON by JSONPath";
|
||||
homepage = "https://github.com/prometheus-community/json_exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ willibutz ];
|
||||
mainProgram = "json_exporter";
|
||||
};
|
||||
}
|
||||
33
pkgs/servers/monitoring/prometheus/kea-exporter.nix
Normal file
33
pkgs/servers/monitoring/prometheus/kea-exporter.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, python3Packages, nixosTests }:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "kea-exporter";
|
||||
version = "0.4.2";
|
||||
|
||||
src = python3Packages.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0dpzicv0ksyda2lprldkj452c23qycl5c9avca6x7f7rbqry9pnd";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
click
|
||||
prometheus-client
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
$out/bin/kea-exporter --help > /dev/null
|
||||
$out/bin/kea-exporter --version | grep -q ${version}
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests.prometheus-exporters) kea;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Export Kea Metrics in the Prometheus Exposition Format";
|
||||
homepage = "https://github.com/mweinelt/kea-exporter";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
|
||||
26
pkgs/servers/monitoring/prometheus/keylight-exporter.nix
Normal file
26
pkgs/servers/monitoring/prometheus/keylight-exporter.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "keylight-exporter";
|
||||
version = "0.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mdlayher";
|
||||
repo = "keylight_exporter";
|
||||
rev = "v${version}";
|
||||
sha256 = "141npawcnxj3sz2xqsnyf06r4x1azk3g55941i8gjr7pwcla34r7";
|
||||
};
|
||||
|
||||
vendorSha256 = "0w065ls8dp687jmps4xdffcarss1wyls14dngr43g58xjw6519gb";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
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";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ mdlayher ];
|
||||
};
|
||||
}
|
||||
39
pkgs/servers/monitoring/prometheus/knot-exporter.nix
Normal file
39
pkgs/servers/monitoring/prometheus/knot-exporter.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ stdenv, fetchFromGitHub, lib, python3, nixosTests }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "knot-exporter";
|
||||
version = "unstable-2021-08-21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ghedo";
|
||||
repo = "knot_exporter";
|
||||
rev = "b18eb7db735b50280f0815497475f4c7092a6550";
|
||||
sha256 = "sha256-FGzkO/KHDhkM3PA2urNQcrMi3MHADkd0YwAvu1jvfrU=";
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) knot; };
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
24
pkgs/servers/monitoring/prometheus/lnd-exporter.nix
Normal file
24
pkgs/servers/monitoring/prometheus/lnd-exporter.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "lndmon";
|
||||
version = "unstable-2021-03-26";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lightninglabs";
|
||||
repo = "lndmon";
|
||||
sha256 = "14lmmjq61p8yhc86swigs43risqi31vlmz7ri8j0n0fyp8lm2kxs";
|
||||
rev = "3aa925aa4f633a6c4d132601922e78f173ae8ac1";
|
||||
};
|
||||
|
||||
vendorSha256 = "06if387b9m02ciqgcissih1x06l33djp87vgspwzz589f77vczk8";
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) lnd; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/lightninglabs/lndmon";
|
||||
description = "Prometheus exporter for lnd (Lightning Network Daemon)";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ mmilata ];
|
||||
};
|
||||
}
|
||||
32
pkgs/servers/monitoring/prometheus/mail-exporter.nix
Normal file
32
pkgs/servers/monitoring/prometheus/mail-exporter.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, nixosTests }:
|
||||
|
||||
buildGoModule {
|
||||
pname = "mailexporter";
|
||||
version = "2020-07-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cherti";
|
||||
repo = "mailexporter";
|
||||
rev = "f5a552c736ac40ccdc0110d2e9a71619c1cd6862";
|
||||
sha256 = "0y7sg9qrd7q6g5gi65sjvw6byfmk2ph0a281wjc9cr4pd25xkciz";
|
||||
};
|
||||
|
||||
vendorSha256 = "1hwahk8v3qnmyn6bwk9l2zpr0k7p2w7zjzxmjwgjyx429g9rzqs0";
|
||||
|
||||
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";
|
||||
homepage = "https://github.com/cherti/mailexporter";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [ willibutz globin ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
26
pkgs/servers/monitoring/prometheus/mikrotik-exporter.nix
Normal file
26
pkgs/servers/monitoring/prometheus/mikrotik-exporter.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "mikrotik-exporter-unstable";
|
||||
version = "2021-08-10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nshttpd";
|
||||
repo = "mikrotik-exporter";
|
||||
sha256 = "1vqn1f159g0l76021gifbxpjf7zjhrj807qqqn51h5413lbi6r66";
|
||||
rev = "4bfa7adfef500ff621a677adfab1f7010af920d1";
|
||||
};
|
||||
|
||||
vendorSha256 = "0b244z3hly5726vwkr7vhdzzm2fi38cv1qh7nvfp3vpsxnii04md";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) mikrotik; };
|
||||
|
||||
meta = with lib; {
|
||||
inherit (src.meta) homepage;
|
||||
description = "Prometheus MikroTik device(s) exporter";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ mmilata ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, buildGoPackage, fetchFromGitHub, fetchpatch }:
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "minio-exporter";
|
||||
version = "0.2.0";
|
||||
rev = "v${version}";
|
||||
|
||||
goPackagePath = "github.com/joe-pll/minio-exporter";
|
||||
|
||||
src= fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "joe-pll";
|
||||
repo = "minio-exporter";
|
||||
sha256 = "1my3ii5s479appiapw8gjzkq1pk62fl7d7if8ljvdj6qw4man6aa";
|
||||
};
|
||||
|
||||
# Required to make 0.2.0 build against latest dependencies
|
||||
# TODO: Remove on update to 0.3.0
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
url = "https://github.com/joe-pll/minio-exporter/commit/50ab89d42322dc3e2696326a9ae4d3f951f646de.patch";
|
||||
sha256 = "0aiixhvb4x8c8abrlf1i4hmca9i6xd6b638a5vfkvawx0q7gxl97";
|
||||
})
|
||||
];
|
||||
|
||||
goDeps = ./deps.nix;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A Prometheus exporter for Minio cloud storage server";
|
||||
homepage = "https://github.com/joe-pll/minio-exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ bachp ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
174
pkgs/servers/monitoring/prometheus/minio-exporter/deps.nix
generated
Normal file
174
pkgs/servers/monitoring/prometheus/minio-exporter/deps.nix
generated
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
|
||||
[
|
||||
{
|
||||
goPackagePath = "github.com/alecthomas/template";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/alecthomas/template";
|
||||
rev = "a0175ee3bccc567396460bf5acd36800cb10c49c";
|
||||
sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/alecthomas/units";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/alecthomas/units";
|
||||
rev = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a";
|
||||
sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/beorn7/perks";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/beorn7/perks";
|
||||
rev = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9";
|
||||
sha256 = "1hrybsql68xw57brzj805xx2mghydpdiysv3gbhr7f5wlxj2514y";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/go-ini/ini";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/go-ini/ini";
|
||||
rev = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a";
|
||||
sha256 = "0mhgxw5q6b0pryhikx3k4wby7g32rwjjljzihi47lwn34kw5y1qn";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/golang/protobuf";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/golang/protobuf";
|
||||
rev = "1e59b77b52bf8e4b449a57e6f79f21226d571845";
|
||||
sha256 = "19bkh81wnp6njg3931wky6hsnnl2d1ig20vfjxpv450sd3k6yys8";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/matttproud/golang_protobuf_extensions";
|
||||
rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c";
|
||||
sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/minio/minio-go";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/minio/minio-go";
|
||||
rev = "d218e4cb1bfc13dcef0eb5c3e74507a35be0dd3a";
|
||||
sha256 = "0d3am33xaavdffz791qi2s0vnkpjw9vlr5p5g4lw7h5vhmy1sjb4";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/minio/minio";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/minio/minio";
|
||||
rev = "bb73c84b104bc447eb603d63481cdc54b8ab3c83";
|
||||
sha256 = "1gjkgdf59yxfr2a7pl3f7z3iid86zsd85xqxcv1s0d46v7j07iga";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/mitchellh/go-homedir";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/mitchellh/go-homedir";
|
||||
rev = "b8bc1bf767474819792c23f32d8286a45736f1c6";
|
||||
sha256 = "13ry4lylalkh4g2vny9cxwvryslzyzwp9r92z0b10idhdq3wad1q";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/client_golang";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/client_golang";
|
||||
rev = "06bc6e01f4baf4ee783ffcd23abfcb0b0f9dfada";
|
||||
sha256 = "0dvv21214sn702kc25y5l0gd9d11358976d3w31fgwx7456mjx26";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/client_model";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/client_model";
|
||||
rev = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c";
|
||||
sha256 = "19y4ywsivhpxj7ikf2j0gm9k3cmyw37qcbfi78n526jxcc7kw998";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/common";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/common";
|
||||
rev = "89604d197083d4781071d3c65855d24ecfb0a563";
|
||||
sha256 = "169rdlaf2mk9z4fydz7ajmngyhmf3q1lk96yhvx46bn986x5xkyn";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/prometheus/procfs";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/prometheus/procfs";
|
||||
rev = "b15cd069a83443be3154b719d0cc9fe8117f09fb";
|
||||
sha256 = "1cr45wg2m40bj2za8f32mq09rjlcnk5kfam0h0hr8wcb015k4wxj";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/sirupsen/logrus";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/sirupsen/logrus";
|
||||
rev = "d682213848ed68c0a260ca37d6dd5ace8423f5ba";
|
||||
sha256 = "0nzyqwzx3k7nqfq8q7yv32gaf3ymq3bpwhkmw1hj2zakq5a93d8x";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "golang.org/x/crypto";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://go.googlesource.com/crypto";
|
||||
rev = "a6600008915114d9c087fad9f03d75087b1a74df";
|
||||
sha256 = "099vyf8133bjwaqcv377d9akam3j5xwamwqrihmjhvzbvqs649yc";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "golang.org/x/net";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://go.googlesource.com/net";
|
||||
rev = "5ccada7d0a7ba9aeb5d3aca8d3501b4c2a509fec";
|
||||
sha256 = "0bdwdxy2gz48icnh023r5fga3z4x6c8gry8jlfjqr5w12y3s281g";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "golang.org/x/sys";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://go.googlesource.com/sys";
|
||||
rev = "2c42eef0765b9837fbdab12011af7830f55f88f0";
|
||||
sha256 = "0gj9nwryyzf9rn33gl3zm6rxvg1zhrhwi36akipqj37x4g86h3gz";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "golang.org/x/text";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://go.googlesource.com/text";
|
||||
rev = "e19ae1496984b1c655b8044a65c0300a3c878dd3";
|
||||
sha256 = "1cvnnx8nwx5c7gr6ajs7sldhbqh52n7h6fsa3i21l2lhx6xrsh4w";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "gopkg.in/alecthomas/kingpin.v2";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://gopkg.in/alecthomas/kingpin.v2";
|
||||
rev = "947dcec5ba9c011838740e680966fd7087a71d0d";
|
||||
sha256 = "0mndnv3hdngr3bxp7yxfd47cas4prv98sqw534mx7vp38gd88n5r";
|
||||
};
|
||||
}
|
||||
]
|
||||
26
pkgs/servers/monitoring/prometheus/modemmanager-exporter.nix
Normal file
26
pkgs/servers/monitoring/prometheus/modemmanager-exporter.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "modemmanager-exporter";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mdlayher";
|
||||
repo = "modemmanager_exporter";
|
||||
rev = "v${version}";
|
||||
sha256 = "0d8z7qzk5j5jj0ixkwpi8dw9kki78mxrajdlzzcj2rcgbnwair91";
|
||||
};
|
||||
|
||||
vendorSha256 = "0f6v97cvzdz7wygswpm87wf8r169x5rw28908vqhmqk644hli4zy";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
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";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ mdlayher ];
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue