shack/prometheus: activate alerting to telegram
This commit is contained in:
parent
306653db95
commit
eaf4ed0b24
17
krebs/2configs/shack/prometheus/alertmanager-telegram.nix
Normal file
17
krebs/2configs/shack/prometheus/alertmanager-telegram.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ pkgs, ...}:
|
||||||
|
{
|
||||||
|
systemd.services.alertmanager-bot-telegram = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "ip-up.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
EnvironmentFile = toString <secrets/shack/telegram_bot.env>;
|
||||||
|
DynamicUser = true;
|
||||||
|
StateDirectory = "alertbot";
|
||||||
|
ExecStart = ''${pkgs.alertmanager-bot-telegram}/bin/alertmanager-bot \
|
||||||
|
--alertmanager.url=http://alert.prometheus.shack --log.level=info \
|
||||||
|
--store=bolt --bolt.path=/var/lib/alertbot/bot.db \
|
||||||
|
--listen.addr="0.0.0.0:16320" \
|
||||||
|
--template.paths=${pkgs.alertmanager-bot-telegram}/templates/default.tmpl'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -118,7 +118,7 @@
|
||||||
];
|
];
|
||||||
alertmanager = {
|
alertmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "0.0.0.0";
|
listenAddress = "127.0.0.1";
|
||||||
configuration = {
|
configuration = {
|
||||||
"global" = {
|
"global" = {
|
||||||
"smtp_smarthost" = "smtp.example.com:587";
|
"smtp_smarthost" = "smtp.example.com:587";
|
||||||
|
@ -134,15 +134,10 @@
|
||||||
"receivers" = [
|
"receivers" = [
|
||||||
{
|
{
|
||||||
"name" = "team-admins";
|
"name" = "team-admins";
|
||||||
"email_configs" = [
|
"email_configs" = [ ];
|
||||||
{
|
|
||||||
"to" = "devnull@example.com";
|
|
||||||
"send_resolved" = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
"webhook_configs" = [
|
"webhook_configs" = [
|
||||||
{
|
{
|
||||||
"url" = "https://example.com/prometheus-alerts";
|
"url" = "http://localhost:8080";
|
||||||
"send_resolved" = true;
|
"send_resolved" = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue