diff --git a/dicos/70_prometheus.xml b/dicos/70_prometheus.xml index f90b44a..ee09e12 100644 --- a/dicos/70_prometheus.xml +++ b/dicos/70_prometheus.xml @@ -1,15 +1,20 @@ - + prometheus 80 443 + 9090 + + + prometheus + 15s @@ -19,9 +24,35 @@ 10s + + non + + + client.prometheus.lan + + + node + + + /etc/prometheus/nodes + + + + non + activer_prometheus + + + non + prometheus + prometheus + + + non + url_nouveau_client_prometheus + diff --git a/tmpl/prometheus.yml b/tmpl/prometheus.yml index 08f7c61..43ed16a 100644 --- a/tmpl/prometheus.yml +++ b/tmpl/prometheus.yml @@ -8,14 +8,29 @@ rule_files: - "/etc/prometheus/rules.d/*.yml" scrape_configs: -- job_name: eole - honor_labels: true + - job_name: %%prometheusJobName + honor_labels: true -alerting: - alertmanagers: - - scheme: https static_configs: - - targets: - - "1.2.3.4:9093" - - "1.2.3.5:9093" - - "1.2.3.6:9093" \ No newline at end of file + - targets: ['%%nom_domaine_machine:9090'] +%if %%getVar('ajout_client_prometheus','non') == 'oui' + %if not %%is_empty(%%url_nouveau_client_prometheus) + %for %%client_prometheus in %%url_nouveau_client_prometheus + - targets: ['%%client_prometheus.%%url_nouveau_client_prometheus:9090'] + %end for + %end if +%end if + + - job_name: '%%job_name_node' + file_sd_configs: + - files: [ "%%job_file_config/*.yml" ] + + +#alerting: +# alertmanagers: +# - scheme: https +# static_configs: +# - targets: +# - "1.2.3.4:9093" +# - "1.2.3.5:9093" +# - "1.2.3.6:9093"