totoro: fix up valve index alerting
This commit is contained in:
parent
4649556303
commit
e6c0cdc415
1 changed files with 20 additions and 5 deletions
|
@ -206,7 +206,7 @@ in {
|
||||||
- name: valve_index
|
- name: valve_index
|
||||||
rules:
|
rules:
|
||||||
- alert: ValveIndexInStock
|
- alert: ValveIndexInStock
|
||||||
expr: valve_index_in_stock == 0
|
expr: valve_index_in_stock > 0
|
||||||
for: 1s
|
for: 1s
|
||||||
labels:
|
labels:
|
||||||
severity: page
|
severity: page
|
||||||
|
@ -225,10 +225,8 @@ in {
|
||||||
};
|
};
|
||||||
receivers = [{
|
receivers = [{
|
||||||
name = "default-receiver";
|
name = "default-receiver";
|
||||||
slack_configs = [{
|
webhook_configs = [{
|
||||||
send_resolved = true;
|
url = "http://localhost:9997";
|
||||||
api_url = secrets.monitoring.alertmanager.discord.api_url;
|
|
||||||
channel = "#alerts";
|
|
||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
@ -296,5 +294,22 @@ in {
|
||||||
};
|
};
|
||||||
my.prometheus.additionalExporterPorts.valveindexinstock = 9998;
|
my.prometheus.additionalExporterPorts.valveindexinstock = 9998;
|
||||||
|
|
||||||
|
systemd.services.alertmanager-discord = {
|
||||||
|
enable = true;
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${depot.pkgs.alertmanager-discord}/bin/alertmanager-discord -listen.address 127.0.0.1:9997";
|
||||||
|
EnvironmentFile = pkgs.writeText "discord-secret" ''
|
||||||
|
DISCORD_WEBHOOK=${secrets.monitoring.alertmanager.discord.api_url}
|
||||||
|
'';
|
||||||
|
DynamicUser = true;
|
||||||
|
MountAPIVFS = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
PrivateUsers = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "20.03";
|
system.stateVersion = "20.03";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue