diff --git a/dicos/70_prometheus.xml b/dicos/70_prometheus.xml index 5f0dbd3..4fda90d 100644 --- a/dicos/70_prometheus.xml +++ b/dicos/70_prometheus.xml @@ -2,7 +2,7 @@ - + prometheus @@ -18,20 +18,20 @@ - - oui + + oui - + - - oui - - - oui - - + + oui + + + oui + + prometheus - + 15s @@ -41,88 +41,105 @@ 10s - - node - - + + node + + /etc/prometheus/nodes - - - + non - - - - + + + + + Node Exporter + + + + + oui + + + 15 + + + 10 + + + http + - + non - - - - + + + + + - - - localhost - - - 86400 + + + + localhost + + + 86400 + + + admin + + + false + + + false + + + + + + + + + non - - admin + + non - - false - - - false - - - - - - - - - non - - - non - - - + + - - + + - + - - - - + + + + - - - - + + + + - - - - + + + + - Services complèmentairse - Configuration du serveur Prometheus + Services complèmentairse + Configuration du serveur Prometheus + Configuration des jobs standards Configuration SMTP pour l'envois des alertes Destinatires Rêgles de distribution simples @@ -137,6 +154,13 @@ alReceiverEmail + + scrpInterval + scrpTimeout + honorLabels + scrpScheme + + alRouteMatchSource alRouteMatchValue @@ -155,18 +179,23 @@ alSubRouteMatchReceiver - - prCliIP - prCliSonde + + prTargIP + prTargSonde - - prOpenCliIP - prOpenCliPort + + prOpenTargIP + prOpenTargPort + prOpenTargJob - - ['Node Exporter','Port'] + + ['Node Exporter'] + + + + ['http','https'] @@ -208,17 +237,17 @@ alertmanager - + non - prCli - prCliIP - prCliSonde + prTarg + prTargIP + prTargSonde - + non - prOpenCli - prOpenCliIP - prOpenCliPort + prOpenTarg + prOpenTargIP + prOpenTargPort diff --git a/postservice/88_grafana b/postservice/88_grafana index 3459bcd..fcac009 100755 --- a/postservice/88_grafana +++ b/postservice/88_grafana @@ -73,7 +73,7 @@ _EOF_ # rm -rf ${tmpFile} } -grafanaHost=$(CreoleGet srvGrafanaIP 192.168.30.57) +grafanaHost=$(CreoleGet srvGrafanaIP 127.0.0.1) grafanaPort=$(CreoleGet srvGrafanaPort 3000) grafanaUser="admin" grafanaPasswd=$(CreoleGet grafana_admin_passwd admin) diff --git a/tmpl/prometheus.yml b/tmpl/prometheus.yml index cea07be..edefb87 100644 --- a/tmpl/prometheus.yml +++ b/tmpl/prometheus.yml @@ -18,29 +18,40 @@ scrape_configs: %end if ] + + - job_name: '%%job_name_node' file_sd_configs: - files: [ "%%job_file_config/*.yml" ] -%if %%is_empty('ajout_client_prometheus') or %%is_empty('addPrOpenCli') -# Nothing to configure -%else +%if %%getVar('addTargetPrometheus','non') == 'oui' static_configs: - targets: [ "%%adresse_ip_eth0:9100"%slurp - %if %%getVar('ajout_client_prometheus','non') == 'oui' - %for %%cliPr in %%getVar('prCli',[]) - %if %%cliPr.prCliSonde == 'Node Exporter' -, '%%cliPr.prCliIP:9100'%slurp + %for %%cliPr in %%getVar('prTarg',[]) + %if %%cliPr.prTargSonde == 'Node Exporter' +, '%%cliPr.prTargIP:9100'%slurp %end if %end for - %end if - %if %%getVar('addPrOpenCli','non') == 'oui' - %for %%cliOpen in %%getVar('prOpenCli',[]) -, '%%cliOpen.prOpenCliIP:%%cliOpen.prOpenCliPort'%slurp - %end for - %end if ] %end if +%for %%job in %%getVar('promJobs', []) + - job_name: '%%job' + %if %%job.honorLabels == 'oui' + honor_labels: true + %else + honor_labels: false + %end if + scrape_interval: %%{job.scrpInterval}s + scrape_timeout: %%{job.scrpTimeout}s + scheme: %%job.scrpScheme + %for %%target in %%getVar('prOpenTarg',[]) + static_configs: + %if %%target.prOpenTargJob == %%job + - targets: [ "%%target.prOpenTargIP:%%target.prOpenTargPort" ] + %end if + %end for +%end for + %if %%getVar('activerAlertmanager','non') == 'oui' alerting: alertmanagers: