71 lines
1.5 KiB
Nix
71 lines
1.5 KiB
Nix
{ config, pkgs, ... }:
|
|
{
|
|
sops.secrets.xmpp-password = {
|
|
owner = "solid-xmpp-alarm";
|
|
group = "solid-xmpp-alarm";
|
|
};
|
|
|
|
services.solid-xmpp-alarm = {
|
|
enable = true;
|
|
jid = "feuer@fem-net.de";
|
|
passwordFile = config.sops.secrets.xmpp-password.path;
|
|
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"
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
}
|