Add alertmanager config

This commit is contained in:
Pablo Ovelleiro Corral 2024-04-27 00:08:23 +02:00
parent 505d0f34ea
commit d8e7b50ddd
Signed by: pinpox
GPG key ID: 29E9A6ED72CCB334

View file

@ -1,6 +1,4 @@
{ config { config
, lib
, pkgs
, flake , flake
, ... , ...
}: { }: {
@ -65,5 +63,39 @@
}]; }];
} }
]; ];
alertmanager = {
enable = true;
# port = 9093; # Default
webExternalUrl = "https://alerts.pub.solar";
# environmentFile = "${config.age.secrets.nachtigall-alertmanager-envfile.path}";
configuration = {
route = {
receiver = "all";
group_by = [ "instance" ];
group_wait = "30s";
group_interval = "2m";
repeat_interval = "24h";
};
receivers = [{
name = "all";
# Email config documentation: https://prometheus.io/docs/alerting/latest/configuration/#email_config
email_configs = [{
send_resolved = true;
to = "TODO";
from = "alerts@pub.solar";
smarthost = "TODO";
auth_username = "TODO";
auth_password_file = "${config.age.secrets.nachtigall-alertmanager-smtp-password.path}";
require_tls = true;
}];
# TODO:
# For matrix notifications, look into: https://github.com/pinpox/matrix-hook and add a webhook
# webhook_configs = [ { url = "http://127.0.0.1:11000/alert"; } ];
}];
};
};
}; };
} }