try folder size exporter
This commit is contained in:
parent
71906365ca
commit
6ae583f46f
|
@ -7,6 +7,10 @@
|
||||||
with lib; {
|
with lib; {
|
||||||
config = {
|
config = {
|
||||||
m-0.monitoring = [
|
m-0.monitoring = [
|
||||||
|
{
|
||||||
|
host = "hera:9974";
|
||||||
|
name = "hera-folder-sizes";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
host = "apollo:9100";
|
host = "apollo:9100";
|
||||||
name = "apollo";
|
name = "apollo";
|
||||||
|
|
|
@ -29,6 +29,7 @@ in {
|
||||||
../../roles/mailman.nix
|
../../roles/mailman.nix
|
||||||
../../roles/firefox-sync.nix
|
../../roles/firefox-sync.nix
|
||||||
../../roles/goatcounter.nix
|
../../roles/goatcounter.nix
|
||||||
|
../../roles/prometheus-folder-size-exporter.nix
|
||||||
./web.nix
|
./web.nix
|
||||||
./mail.nix
|
./mail.nix
|
||||||
./boot.nix
|
./boot.nix
|
||||||
|
|
|
@ -39,6 +39,7 @@ in {
|
||||||
nixos.source = "/disk/persist/maralorn/git/config";
|
nixos.source = "/disk/persist/maralorn/git/config";
|
||||||
machine-id.source = "/disk/persist/machine-id";
|
machine-id.source = "/disk/persist/machine-id";
|
||||||
};
|
};
|
||||||
|
environment.systemPackages = [pkgs.prometheus-folder-size-exporter];
|
||||||
|
|
||||||
systemd.services."activate-home-manager" = {
|
systemd.services."activate-home-manager" = {
|
||||||
path = [pkgs.nix pkgs.dbus];
|
path = [pkgs.nix pkgs.dbus];
|
||||||
|
|
22
nixos/roles/prometheus-folder-size-exporter.nix
Normal file
22
nixos/roles/prometheus-folder-size-exporter.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{pkgs, ...}: let
|
||||||
|
config = [
|
||||||
|
{
|
||||||
|
"path" = "/";
|
||||||
|
explode_depth = 1;
|
||||||
|
"sum_remaining_subfolders" = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
systemd.services.prometheus-folder-size-exporter = {
|
||||||
|
after = ["network-online.target"];
|
||||||
|
wants = ["network-online.target"];
|
||||||
|
description = "Prometheus folder size exporter";
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${pkgs.prometheus-folder-size-exporter}/bin/prometheus-folder-size-exporter -b 60 -i ${builtins.toJSON config} -p 9974";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
13
overlays/prometheus-folder-size-exporter.nix
Normal file
13
overlays/prometheus-folder-size-exporter.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
final: prev: {
|
||||||
|
prometheus-folder-size-exporter = final.rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "prometheus_folder_size_exporter";
|
||||||
|
version = "0.5.0";
|
||||||
|
src = final.fetchFromGitHub {
|
||||||
|
owner = "MindFlavor";
|
||||||
|
repo = pname;
|
||||||
|
rev = version;
|
||||||
|
sha256 = "sha256-G1oWGiTyftloPxgOuiYFO7hofHdbwPCG4QDXK1t5qWk=";
|
||||||
|
};
|
||||||
|
cargoSha256 = "sha256:0baxb2fqdywfj9jxmhinm7fqyyn6sdfh6s5vnn7mgwawg00b7h7l";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue