1
0
nixfiles/hosts/monitoring-3/alertmanager.nix

66 lines
1.4 KiB
Nix

{ pkgs, ... }:
{
services.solid-xmpp-alarm = {
enable = true;
jid = "feuer@fem-net.de";
passwordFile = "/var/src/secrets/xmpp-alert/password";
receiver = "clerie@fem-net.de";
};
services.prometheus.alertmanager = {
enable = true;
listenAddress = "[::1]";
port = 9093;
configuration = {
route = {
receiver = "xmpp-receiver";
repeat_interval = "4h";
group_by = [ "instance" ];
routes = [
{
matchers = [
''severity = "muted"''
];
receiver = "muted";
}
{
receiver = "xmpp-receiver";
matchers = [
''severity = "warning"''
];
repeat_interval = "70h";
}
];
};
receivers = [
{
name = "muted";
}
{
name = "xmpp-receiver";
webhook_configs = [
{
url = "http://[::1]:9199/alert";
}
];
}
];
inhibit_rules = [
{
# Mute all alerts for an instance which also has an alert starting with MuteInstanceOn
target_matchers = [
''alertname =~ ".+"''
];
source_matchers = [
''mute = "instance"''
];
equal = [
"instance"
];
}
];
};
};
}