From 20c3d92475e0c26ae54836b96a4a98c35adc68fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 23 Mar 2023 12:13:40 +0100 Subject: nixos: measure network speed periodically on edge routers --- nixos/modules/monitoring.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'nixos/modules') diff --git a/nixos/modules/monitoring.nix b/nixos/modules/monitoring.nix index 2660461..e08ae14 100644 --- a/nixos/modules/monitoring.nix +++ b/nixos/modules/monitoring.nix @@ -20,6 +20,11 @@ in { default = true; description = "If hardware should be reported"; }; + speedtest = mkOption { + type = types.bool; + default = false; + description = "If speedtest should be used to measure connection speed"; + }; host = mkOption { type = types.str; @@ -87,6 +92,14 @@ in { } ]; wireless = [{}]; + }) // (optionaAttrs cnf.speedtest { + exec = [{ + commands = ["${pkgs.speedtest-cli}/bin/speedtest --json"]; + name_override = "speedtest"; + timeout = "5m"; + interval = "15m"; + data_format = "json"; + }]; }); }; }; -- cgit v1.2.3