24 lines
600 B
Nix
24 lines
600 B
Nix
{ lib, pkgs, config, ... }: # Standard module arguments
|
|
{
|
|
services.vmalert.rules.groups = [
|
|
{
|
|
name = "HostStatusAlerts";
|
|
rules = [
|
|
{
|
|
alert = "HostDown";
|
|
expr = "up == 0";
|
|
for = "2m";
|
|
labels = {
|
|
severity = "critical";
|
|
category = "availability";
|
|
};
|
|
annotations = {
|
|
summary = "Host {{ $labels.instance }} is down";
|
|
description = "Host {{ $labels.instance }} (job: {{ $labels.job }}) has been down for more than 2 minutes.";
|
|
};
|
|
}
|
|
];
|
|
}
|
|
];
|
|
}
|