Improving dico to be more Prometheus like

We need to be closer to the prometheus way to do things
This commit is contained in:
2018-06-06 16:09:57 +02:00
parent ab479fd33a
commit e95d6f9e1d
2 changed files with 28 additions and 25 deletions

View File

@ -26,25 +26,23 @@ scrape_configs:
%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
]
%end if
%for %%job in %%getVar['promJobs',[]]
%for %%job in %%getVar('promJobs', [])
- job_name: '%%job'
%if %%job.honorLabels == 'oui'
honor_labels: true
%else
honor_labels; false
honor_labels: false
%end if
scrape_interval: %%job.scrpInterval
scrape_timeout: %%job.scrpTimeout
scrape_interval: %%{job.scrpInterval}s
scrape_timeout: %%{job.scrpTimeout}s
scheme: %%job.scrpScheme
%for %%target in %%getVar('prOpenTarg',[])
static_configs: