feat: implement centralized alerting with vmalert and Grafana, add alert rules for CPU, disk, inode, RAM usage, and host status
This commit is contained in:
23
hosts/web-arm/modules/vmalert/rules/host_down.nix
Normal file
23
hosts/web-arm/modules/vmalert/rules/host_down.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ 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.";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user