# my global config global: scrape_interval: %%prometheusScrapeInterval evaluation_interval: %%prometheusEvaluationInterval scrape_timeout: %%prometheusScrapeTimeout rule_files: - "/etc/prometheus/rules.d/*.yml" scrape_configs: - job_name: %%prometheusJobName honor_labels: true static_configs: - targets: ['%%nom_domaine_machine:9090'%slurp %if %%getVar('activerSndNodeExpoter','non') == 'oui' , '%%nom_domaine_machine:9100'%slurp %end if ] - job_name: '%%job_name_node' file_sd_configs: # - files: [ "%%job_file_config/*.yml" ] %if %%getVar('addTargetPrometheus','non') == 'oui' static_configs: - targets: [ "%%adresse_ip_eth0:9100"%slurp %for %%cliPr in %%getVar('prTarg',[]) %if %%cliPr.prTargSonde == 'Node Exporter' , '%%cliPr.prTargIP:9100'%slurp %end if %end for ] %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 metrics_path: %%job.scrpMetricPath %set first = True static_configs: - targets: [ %slurp %for %%target in %%getVar('prOpenTarg',[]) %if %%target.prOpenTargJob == %%job %if %%first "%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp %set first = False %else , "%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp %end if %end if %end for ] %end for %if %%getVar('activerAlertmanager','non') == 'oui' alerting: alertmanagers: - scheme: http static_configs: - targets: - "%%nom_domaine_machine:9093" %end if