From 4d0fc19a3491af075756c3125cad3730e28d0f48 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 15 Sep 2020 22:16:28 +0100 Subject: [PATCH] Configure SMTP for prometheus --- cookbooks/prometheus/recipes/server.rb | 1 + cookbooks/prometheus/templates/default/grafana.ini.erb | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/cookbooks/prometheus/recipes/server.rb b/cookbooks/prometheus/recipes/server.rb index 2fcaddf47..5132eabdd 100644 --- a/cookbooks/prometheus/recipes/server.rb +++ b/cookbooks/prometheus/recipes/server.rb @@ -58,6 +58,7 @@ end service "grafana-server" do action [:enable, :start] + subscribes :restart, "template[/etc/grafana/grafana.ini]" end apache_module "alias" diff --git a/cookbooks/prometheus/templates/default/grafana.ini.erb b/cookbooks/prometheus/templates/default/grafana.ini.erb index bdc143777..08f1d5dfd 100644 --- a/cookbooks/prometheus/templates/default/grafana.ini.erb +++ b/cookbooks/prometheus/templates/default/grafana.ini.erb @@ -1,8 +1,17 @@ # DO NOT EDIT - This file is being maintained by Chef +instance_name = prometheus.openstreetmap.org + [server] root_url = https://prometheus.openstreetmap.org/ [security] admin_user = admin admin_password = <%= @passwords[:grafana_admin] %> + +[smtp] +enabled = true +host = localhost:25 +skip_verify = true +from_address = admins@openstreetmap.org +from_name = Prometheus -- 2.39.5