mob next [ci-skip] [ci skip] [skip ci]

lastFile:inventories/default.nix
This commit is contained in:
2026-06-18 18:31:55 +07:00
parent 921e8a86dc
commit c4fef43305
+78 -75
View File
@@ -321,86 +321,89 @@
};
roles.server.machines."rigel".settings = { };
roles.server.extraModules = [
{
(
{ ... }:
{
services.matrix-alertmanager = {
enable = true;
homeserverUrl = "https://matrix-client.matrix.org";
matrixUser = "@kuroiris:matrix.org";
matrixRooms = [
{
receivers = [
"matrix"
];
roomId = "!rqIrWqPvsXqMgYpcNZ:matrix.org";
}
];
};
services.prometheus = {
rules = [
(builtins.toJSON {
groups = [
{
name = "default";
rules = [
{
alert = "test";
expr = ''up{instance!~"(nerr-.*|theatnerr-.*)",job!~"lab-.*|snmp-.*"} == 1'';
for = "1m";
annotations.summary = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.";
}
];
}
];
})
];
alertmanager = {
services.matrix-alertmanager = {
enable = true;
configuration = {
global = {
resolve_timeout = "5m";
};
route = {
receiver = "matrix";
routes = [
{ receiver = "matrix"; }
homeserverUrl = "https://matrix-client.matrix.org";
matrixUser = "@kuroiris:matrix.org";
matrixRooms = [
{
receivers = [
"matrix"
];
};
receivers = [
{
name = "uptime-kuma";
webhook_configs = [
{
url = "https://uptime.b4l.co.th/api/push/$${KUMA_TOKEN}?status=up&msg=OK&ping=";
send_resolved = true;
}
];
}
{
name = "matrix";
webhook_configs = [
{
# url = "http://localhost:3000/alerts?secret=$$KUROIRIS_SECRET";
url_file = "";
send_resolved = true;
}
];
}
];
};
roomId = "!rqIrWqPvsXqMgYpcNZ:matrix.org";
}
];
};
alertmanagers = [
{
scheme = "http";
path_prefix = "/";
static_configs = [ { targets = [ "localhost:9093" ]; } ];
}
];
};
}
services.prometheus = {
rules = [
(builtins.toJSON {
groups = [
{
name = "default";
rules = [
{
alert = "test";
expr = ''up{instance!~"(nerr-.*|theatnerr-.*)",job!~"lab-.*|snmp-.*"} == 1'';
for = "1m";
annotations.summary = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.";
}
];
}
];
})
];
alertmanager = {
enable = true;
configuration = {
global = {
resolve_timeout = "5m";
};
route = {
receiver = "matrix";
routes = [
{ receiver = "matrix"; }
];
};
receivers = [
{
name = "uptime-kuma";
webhook_configs = [
{
url = "https://uptime.b4l.co.th/api/push/$${KUMA_TOKEN}?status=up&msg=OK&ping=";
send_resolved = true;
}
];
}
{
name = "matrix";
webhook_configs = [
{
url = "http://localhost:3000/alerts?secret=$$KUROIRIS_SECRET";
# url_file = "";
send_resolved = true;
}
];
}
];
};
};
alertmanagers = [
{
scheme = "http";
path_prefix = "/";
static_configs = [ { targets = [ "localhost:9093" ]; } ];
}
];
};
}
)
];
roles.nodes.machines = {