fuuko: Add prometheus fritzbox exporter
This commit is contained in:
parent
f388995ef6
commit
70ee44fbc5
|
@ -66,6 +66,10 @@ in
|
|||
"vueko.vpn.sbruder.de:9100"
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "fritzbox";
|
||||
static_configs = mkStaticTarget "127.0.0.1:9133";
|
||||
}
|
||||
];
|
||||
|
||||
rules =
|
||||
|
@ -113,7 +117,18 @@ in
|
|||
};
|
||||
})
|
||||
];
|
||||
|
||||
exporters = {
|
||||
fritzbox = {
|
||||
enable = true;
|
||||
gatewayAddress = "192.168.100.1";
|
||||
listenAddress = "127.0.0.1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# get rid of “could not call action: authorization required” every scrape
|
||||
systemd.services.prometheus-fritzbox-exporter.serviceConfig.StandardOutput = "null";
|
||||
|
||||
krops.secrets.prometheus-htpasswd = {
|
||||
group = "nginx";
|
||||
|
|
|
@ -18,6 +18,10 @@ in
|
|||
|
||||
aria2_exporter = import srcs.aria2_exporter { pkgs = self; };
|
||||
|
||||
# adapted nixpkgs upstream but changed to buildGoModule and updated to
|
||||
# version that works in my setup
|
||||
prometheus-fritzbox-exporter = super.callPackage ./prometheus-fritzbox-exporter { };
|
||||
|
||||
# FIXME: 21.05: Move to home-manager module package attribute
|
||||
mpv-unwrapped = super.mpv-unwrapped.overrideAttrs (o: o // {
|
||||
patches = [
|
||||
|
|
28
pkgs/prometheus-fritzbox-exporter/default.nix
Normal file
28
pkgs/prometheus-fritzbox-exporter/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "fritzbox-exporter";
|
||||
version = "unstable-2021-03-03";
|
||||
rev = "6d66f6b8e47878c61feb710e36306fe714350658";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "mxschmitt";
|
||||
repo = "fritzbox_exporter";
|
||||
sha256 = "0n9fwslcwgfghscrwbz7p3zamb474zk425ijkkh6cixpnc7p3vi6";
|
||||
};
|
||||
|
||||
subPackages = [ "cmd/exporter" ];
|
||||
|
||||
vendorSha256 = "0k6bd052pjfg5c1ba1yhni8msv3wl512vfzy2hrk49jibh8h052n";
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) fritzbox; };
|
||||
|
||||
meta = with stdenv.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 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue