2023-05-02 20:27:03 +02:00
|
|
|
{ config, pkgs, ... }:
|
2023-02-03 22:28:50 +01:00
|
|
|
{
|
2023-05-02 20:27:03 +02:00
|
|
|
age.secrets.xmpp-password = {
|
|
|
|
owner = "solid-xmpp-alarm";
|
|
|
|
group = "solid-xmpp-alarm";
|
|
|
|
};
|
|
|
|
|
2023-02-06 13:38:16 +01:00
|
|
|
services.solid-xmpp-alarm = {
|
2023-02-03 22:28:50 +01:00
|
|
|
enable = true;
|
2023-02-06 13:38:16 +01:00
|
|
|
jid = "feuer@fem-net.de";
|
2023-05-02 20:27:03 +02:00
|
|
|
passwordFile = config.age.secrets.xmpp-password.path;
|
2023-02-06 13:38:16 +01:00
|
|
|
receiver = "clerie@fem-net.de";
|
2023-02-03 22:28:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|