71 lines
1.5 KiB
Nix
71 lines
1.5 KiB
Nix
|
{ ... }:
|
||
|
{
|
||
|
services.prometheus.xmpp-alerts = {
|
||
|
enable = true;
|
||
|
settings = {
|
||
|
jid = "feuer@fem-net.de";
|
||
|
password_command = "cat /var/src/secrets/xmpp-alert/password";
|
||
|
listen_address = "::1";
|
||
|
listen_port = 9199;
|
||
|
to_jid = "clerie@fem-net.de";
|
||
|
format = "short";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
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"
|
||
|
];
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
|
||
|
}
|