From f9cb3d35b11bdcdc8578a3c82fb19712a03f714b Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Tue, 26 Jun 2018 13:20:08 +0200 Subject: [PATCH 1/3] Adding support for mail sending from smtp gateway --- dicos/70_prometheus.xml | 1 + tmpl/grafana.ini | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dicos/70_prometheus.xml b/dicos/70_prometheus.xml index ca108d3..e5a3352 100644 --- a/dicos/70_prometheus.xml +++ b/dicos/70_prometheus.xml @@ -105,6 +105,7 @@ false + diff --git a/tmpl/grafana.ini b/tmpl/grafana.ini index ba811af..341b329 100644 --- a/tmpl/grafana.ini +++ b/tmpl/grafana.ini @@ -40,11 +40,13 @@ domain = %%grafana_domain # Redirect to correct domain if host header does not match domain # Prevents DNS rebinding attacks -;enforce_domain = false +enforce_domain = true # The full public facing url you use in browser, used for redirects and emails # If you use reverse proxy and sub path specify full url (with sub path) -;root_url = http://localhost:3000 +%if %%is_empty('grafanaRootURL') +root_url = %%grafanaRootURL +%end if # Log web requests ;router_logging = false @@ -299,18 +301,20 @@ enabled = %%grafana_auth_anonymous #################################### SMTP / Emailing ########################## [smtp] -;enabled = false -;host = localhost:25 +%if %%getVar('activer_exim_relay_smtp','non') == 'oui' +enabled = true +host = %%exim_relay_smtp:25 ;user = # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" ;password = ;cert_file = ;key_file = -;skip_verify = false -;from_address = admin@grafana.localhost -;from_name = Grafana +skip_verify = true +from_address = %%system_mail_from +from_name = Grafana # EHLO identity in SMTP dialog (defaults to instance_name) ;ehlo_identity = dashboard.example.com +%end if [emails] ;welcome_email_on_sign_up = false From c25b004d3bd21e0864956b46ddbdf143b2a4ed08 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 26 Jun 2018 14:06:37 +0200 Subject: [PATCH 2/3] =?UTF-8?q?r=C3=A9glage=20niveau=20alert=20du=20filesy?= =?UTF-8?q?st=C3=A8me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmpl/alert-rules.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmpl/alert-rules.yml b/tmpl/alert-rules.yml index 2eb4b80..8c6a684 100644 --- a/tmpl/alert-rules.yml +++ b/tmpl/alert-rules.yml @@ -33,7 +33,7 @@ groups: # Heavy "/" use - alert: filesystem_threshold_exceeded expr: node_filesystem_avail{job="%%{job_name_node}",mountpoint="/"} / node_filesystem_size{job="%%{job_name_node}"} - * 100 < 90 + * 100 < 20 annotations: description: This device's filesystem usage has exceeded the threshold with a value of {{ $value }}. From 0a3658fa5705d1a8388086a1ed78c6101e5959a9 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 26 Jun 2018 15:05:24 +0200 Subject: [PATCH 3/3] =?UTF-8?q?ajout=20chemin=20personnalis=C3=A9=20pour?= =?UTF-8?q?=20les=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dicos/70_prometheus.xml | 6 +++++- tmpl/prometheus.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dicos/70_prometheus.xml b/dicos/70_prometheus.xml index e5a3352..4a8ecd9 100644 --- a/dicos/70_prometheus.xml +++ b/dicos/70_prometheus.xml @@ -78,6 +78,9 @@ http + + /metrics + non @@ -168,7 +171,8 @@ scrpInterval scrpTimeout honorLabels - scrpScheme + scrpScheme + scrpMetricPath diff --git a/tmpl/prometheus.yml b/tmpl/prometheus.yml index f305d20..b725259 100644 --- a/tmpl/prometheus.yml +++ b/tmpl/prometheus.yml @@ -44,6 +44,7 @@ scrape_configs: scrape_interval: %%{job.scrpInterval}s scrape_timeout: %%{job.scrpTimeout}s scheme: %%job.scrpScheme + metrics_path: %%job.scrpMetricPath %set first = True static_configs: - targets: [ %slurp