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
|
||||
rules:
|
||||
- alert: ValveIndexInStock
|
||||
expr: valve_index_in_stock == 0
|
||||
expr: valve_index_in_stock > 0
|
||||
for: 1s
|
||||
labels:
|
||||
severity: page
|
||||
|
@ -225,10 +225,8 @@ in {
|
|||
};
|
||||
receivers = [{
|
||||
name = "default-receiver";
|
||||
slack_configs = [{
|
||||
send_resolved = true;
|
||||
api_url = secrets.monitoring.alertmanager.discord.api_url;
|
||||
channel = "#alerts";
|
||||
webhook_configs = [{
|
||||
url = "http://localhost:9997";
|
||||
}];
|
||||
}];
|
||||
};
|
||||
|
@ -296,5 +294,22 @@ in {
|
|||
};
|
||||
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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue