summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/prometheus
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-09-13 23:52:22 +0200
committermakefu <github@syntax-fehler.de>2020-09-14 00:14:40 +0200
commiteaf4ed0b24dcc89191d018fa4ebd9331e22ea324 (patch)
tree837a69d13252997089847e7a12f2a106fbcd2597 /krebs/2configs/shack/prometheus
parent306653db954b41759fccfbd8b9d42ff712fe64f0 (diff)
shack/prometheus: activate alerting to telegram
Diffstat (limited to 'krebs/2configs/shack/prometheus')
-rw-r--r--krebs/2configs/shack/prometheus/alertmanager-telegram.nix17
-rw-r--r--krebs/2configs/shack/prometheus/server.nix11
2 files changed, 20 insertions, 8 deletions
diff --git a/krebs/2configs/shack/prometheus/alertmanager-telegram.nix b/krebs/2configs/shack/prometheus/alertmanager-telegram.nix
new file mode 100644
index 000000000..9d0ef45e8
--- /dev/null
+++ b/krebs/2configs/shack/prometheus/alertmanager-telegram.nix
@@ -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'';
+ };
+ };
+}
diff --git a/krebs/2configs/shack/prometheus/server.nix b/krebs/2configs/shack/prometheus/server.nix
index c088a3b08..8f37f4478 100644
--- a/krebs/2configs/shack/prometheus/server.nix
+++ b/krebs/2configs/shack/prometheus/server.nix
@@ -118,7 +118,7 @@
];
alertmanager = {
enable = true;
- listenAddress = "0.0.0.0";
+ listenAddress = "127.0.0.1";
configuration = {
"global" = {
"smtp_smarthost" = "smtp.example.com:587";
@@ -134,15 +134,10 @@
"receivers" = [
{
"name" = "team-admins";
- "email_configs" = [
- {
- "to" = "devnull@example.com";
- "send_resolved" = true;
- }
- ];
+ "email_configs" = [ ];
"webhook_configs" = [
{
- "url" = "https://example.com/prometheus-alerts";
+ "url" = "http://localhost:8080";
"send_resolved" = true;
}
];