@cryptotaxi247 / infra-1 / commits / d51de0ce

pluto: Enable storagebox exporter and scrape it

This runs the Hetzner storagebox exporter on Pluto and also has Prometheus scrape it. Co-Authored-By: Martin Weinelt <hexa@darmstadt.ccc.de> Closes: #853

Dionysis Grigoropoulos committed Jan 20, 2026 at 15:44 UTC d51de0ce981b393315fab07dfc014d0efaa0fccb
4 files changed +47
build/pluto/prometheus/default.nix
+1
@@ -17,6 +17,7 @@
17 ./exporters/owncast.nix
18 ./exporters/postgresql.nix
19 ./exporters/rasdaemon.nix
20 + ./exporters/storagebox.nix
21 ./exporters/sql.nix
22 ./exporters/up.nix
23 ./exporters/zfs.nix
build/pluto/prometheus/exporters/storagebox.nix new
+45
@@ -0,0 +1,45 @@
1 +{
2 + config,
3 + pkgs,
4 + ...
5 +}:
6 +{
7 + age.secrets."storagebox-exporter-token".file = ../../../secrets/storagebox-exporter-token.age;
8 +
9 + services.prometheus = {
10 + exporters.storagebox = {
11 + enable = true;
12 + listenAddress = "localhost";
13 + tokenFile = config.age.secrets."storagebox-exporter-token".path;
14 + };
15 +
16 + scrapeConfigs = [
17 + {
18 + job_name = "storagebox";
19 + scheme = "http";
20 + static_configs = [ { targets = [ "localhost:9509" ]; } ];
21 + }
22 + ];
23 +
24 + ruleFiles = [
25 + (pkgs.writeText "storagebox-exporter.rules" (
26 + builtins.toJSON {
27 + groups = [
28 + {
29 + name = "storagebox";
30 + rules = [
31 + {
32 + alert = "StorageboxCapacity";
33 + expr = "round(100 * (1 - (storagebox_disk_usage / storagebox_disk_quota))) < 10";
34 + for = "30m";
35 + labels.severity = "warning";
36 + annotations.summary = "StorageBox {{ $labels.name }} ({ $labels.server }}) has less than {{ $value }}% free space.";
37 + }
38 + ];
39 + }
40 + ];
41 + }
42 + ))
43 + ];
44 + };
45 +}
build/secrets.nix
+1
@@ -15,6 +15,7 @@ let
15 rfc39-credentials = [ machines.pluto ];
16 rfc39-github = [ machines.pluto ];
17 rfc39-record-push = [ machines.pluto ];
18 + storagebox-exporter-token = [ machines.pluto ];
19 tarball-mirror-aws-credentials = [ machines.pluto ];
20 zrepl-ssh-key = [ machines.titan ];
21 };
build/secrets/storagebox-exporter-token.age
Binary files /dev/null and b/build/secrets/storagebox-exporter-token.age differ