mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-09 20:31:10 +00:00
add cpu check
This commit is contained in:
parent
8709b019ea
commit
5095057a13
12 changed files with 123 additions and 21 deletions
|
|
@ -11,7 +11,7 @@ package:
|
|||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
|
||||
|
||||
config = let
|
||||
cfg = config.services.lego-monitoring;
|
||||
json = pkgs.formats.json {};
|
||||
|
|
@ -49,6 +49,11 @@ package:
|
|||
}) cfg.checks.temp.sensors;
|
||||
|
||||
vulnix.whitelist_path = vulnixWhitelistFile;
|
||||
|
||||
cpu = with cfg.checks.cpu; {
|
||||
warning_percentage = warningPercentage;
|
||||
critical_percentage = criticalPercentage;
|
||||
};
|
||||
};
|
||||
};
|
||||
in lib.mkIf cfg.enable {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ in
|
|||
"start"
|
||||
"stop"
|
||||
"temp"
|
||||
"cpu"
|
||||
"vulnix"
|
||||
]);
|
||||
default = [ ];
|
||||
|
|
@ -76,6 +77,19 @@ in
|
|||
}'';
|
||||
};
|
||||
};
|
||||
|
||||
cpu = {
|
||||
warningPercentage = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.float;
|
||||
default = 80.0;
|
||||
description = "CPU load percentage for a warning alert is sent. Null means never generate a CPU warning alert.";
|
||||
};
|
||||
criticalPercentage = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.float;
|
||||
default = 90.0;
|
||||
description = "CPU load percentage for a critical alert to be sent. Null means never generate a CPU critical alert.";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue