aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/monitoring.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-03-23 12:13:40 +0100
committerKarel Kočí <cynerd@email.cz>2023-03-23 12:13:40 +0100
commit20c3d92475e0c26ae54836b96a4a98c35adc68fd (patch)
treef80c8237a5bac0805ef4144d470bf5907feb2d0b /nixos/modules/monitoring.nix
parentd80608970affe5defe030b730cbce9b6ee75fa6d (diff)
downloadnixos-personal-20c3d92475e0c26ae54836b96a4a98c35adc68fd.tar.gz
nixos-personal-20c3d92475e0c26ae54836b96a4a98c35adc68fd.tar.bz2
nixos-personal-20c3d92475e0c26ae54836b96a4a98c35adc68fd.zip
nixos: measure network speed periodically on edge routers
Diffstat (limited to 'nixos/modules/monitoring.nix')
-rw-r--r--nixos/modules/monitoring.nix13
1 files changed, 13 insertions, 0 deletions
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";
+ }];
});
};
};