lol

nixos/prometheus/storagebox: Init module

+65
+2
nixos/doc/manual/release-notes/rl-2511.section.md
··· 116 116 117 117 - [SuiteNumérique Meet](https://github.com/suitenumerique/meet) is an open source alternative to Google Meet and Zoom powered by LiveKit: HD video calls, screen sharing, and chat features. Built with Django and React. Available as [services.lasuite-meet](#opt-services.lasuite-meet.enable). 118 118 119 + - [Prometheus Storagebox Exporter](https://github.com/fleaz/prometheus-storagebox-exporter), a Prometheus exporter for Hetzner storage boxes. 120 + 119 121 - [lemurs](https://github.com/coastalwhite/lemurs), a customizable TUI display/login manager. Available at [services.displayManager.lemurs](#opt-services.displayManager.lemurs.enable). 120 122 121 123 - [paisa](https://github.com/ananthakumaran/paisa), a personal finance tracker and dashboard. Available as [services.paisa](#opt-services.paisa.enable).
+1
nixos/modules/services/monitoring/prometheus/exporters.nix
··· 124 124 "snmp" 125 125 "sql" 126 126 "statsd" 127 + "storagebox" 127 128 "surfboard" 128 129 "systemd" 129 130 "tibber"
+47
nixos/modules/services/monitoring/prometheus/exporters/storagebox.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + options, 6 + ... 7 + }: 8 + 9 + let 10 + cfg = config.services.prometheus.exporters.storagebox; 11 + inherit (lib) mkPackageOption; 12 + in 13 + { 14 + port = 9509; 15 + extraOpts = { 16 + package = mkPackageOption pkgs "prometheus-storagebox-exporter" { }; 17 + tokenFile = lib.mkOption { 18 + type = lib.types.pathWith { 19 + inStore = false; 20 + absolute = true; 21 + }; 22 + description = "File that contains the Hetzner API token to use."; 23 + }; 24 + 25 + }; 26 + serviceOpts = { 27 + after = [ "network.target" ]; 28 + wantedBy = [ "multi-user.target" ]; 29 + script = '' 30 + export HETZNER_TOKEN=$(< "''${CREDENTIALS_DIRECTORY}/token") 31 + exec ${lib.getExe cfg.package} 32 + ''; 33 + 34 + environment = { 35 + LISTEN_ADDR = "${toString cfg.listenAddress}:${toString cfg.port}"; 36 + }; 37 + 38 + serviceConfig = { 39 + DynamicUser = true; 40 + Restart = "always"; 41 + RestartSec = "10s"; 42 + LoadCredential = [ 43 + "token:${cfg.tokenFile}" 44 + ]; 45 + }; 46 + }; 47 + }
+15
nixos/tests/prometheus-exporters.nix
··· 1615 1615 ''; 1616 1616 }; 1617 1617 1618 + storagebox = { 1619 + exporterConfig = { 1620 + enable = true; 1621 + tokenFile = "/tmp/faketoken"; 1622 + }; 1623 + exporterTest = '' 1624 + succeed( 1625 + 'echo faketoken > /tmp/faketoken' 1626 + ) 1627 + wait_for_unit("prometheus-storagebox-exporter.service") 1628 + wait_for_open_port(9509) 1629 + succeed("curl -sSf localhost:9509/metrics | grep 'process_open_fds'") 1630 + ''; 1631 + }; 1632 + 1618 1633 snmp = { 1619 1634 exporterConfig = { 1620 1635 enable = true;