25 lines
810 B
Nix
25 lines
810 B
Nix
{ lib }:
|
|
lib.mapAttrsToList
|
|
(name: opts: {
|
|
alert = name;
|
|
expr = opts.condition;
|
|
for = opts.time or "2m";
|
|
labels = { };
|
|
annotations.description = opts.description;
|
|
})
|
|
{
|
|
|
|
# TODO Remove this alert, just for testing
|
|
"Filesystem > = 10%" = {
|
|
condition = ''disk_used_percent{fstype!~"tmpfs|vfat|devtmpfs|efivarfs"} > 10'';
|
|
time = "1m";
|
|
description = "{{$labels.instance}} device {{$labels.device}} on {{$labels.path}} got less than 90% space left on its filesystem.";
|
|
};
|
|
|
|
filesystem_full_80percent = {
|
|
condition = ''disk_used_percent{fstype!~"tmpfs|vfat|devtmpfs|efivarfs"} > 80'';
|
|
time = "1m";
|
|
description = "{{$labels.instance}} device {{$labels.device}} on {{$labels.path}} got less than 20% space left on its filesystem.";
|
|
};
|
|
}
|