Eolisation de Prometheus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

prometheus.yml 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # my global config
  2. global:
  3. scrape_interval: %%prometheusScrapeInterval
  4. evaluation_interval: %%prometheusEvaluationInterval
  5. scrape_timeout: %%prometheusScrapeTimeout
  6. rule_files:
  7. - "/etc/prometheus/rules.d/*.yml"
  8. scrape_configs:
  9. - job_name: %%prometheusJobName
  10. honor_labels: true
  11. static_configs:
  12. - targets: ['%%nom_domaine_machine:9090'%slurp
  13. %if %%getVar('activerSndNodeExpoter','non') == 'oui'
  14. , '%%nom_domaine_machine:9100'%slurp
  15. %end if
  16. ]
  17. - job_name: '%%job_name_node'
  18. file_sd_configs:
  19. # - files: [ "%%job_file_config/*.yml" ]
  20. %if %%getVar('addTargetPrometheus','non') == 'oui'
  21. static_configs:
  22. - targets: [ "%%adresse_ip_eth0:9100"%slurp
  23. %for %%cliPr in %%getVar('prTarg',[])
  24. %if %%cliPr.prTargSonde == 'Node Exporter'
  25. , '%%cliPr.prTargIP:9100'%slurp
  26. %end if
  27. %end for
  28. ]
  29. %end if
  30. %for %%job in %%getVar('promJobs', [])
  31. - job_name: '%%job'
  32. %if %%job.honorLabels == 'oui'
  33. honor_labels: true
  34. %else
  35. honor_labels: false
  36. %end if
  37. scrape_interval: %%{job.scrpInterval}s
  38. scrape_timeout: %%{job.scrpTimeout}s
  39. scheme: %%job.scrpScheme
  40. metrics_path: %%job.scrpMetricPath
  41. %set first = True
  42. static_configs:
  43. - targets: [ %slurp
  44. %for %%target in %%getVar('prOpenTarg',[])
  45. %if %%target.prOpenTargJob == %%job
  46. %if %%first
  47. "%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp
  48. %set first = False
  49. %else
  50. , "%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp
  51. %end if
  52. %end if
  53. %end for
  54. ]
  55. %end for
  56. %if %%getVar('activerAlertmanager','non') == 'oui'
  57. alerting:
  58. alertmanagers:
  59. - scheme: http
  60. static_configs:
  61. - targets:
  62. - "%%nom_domaine_machine:9093"
  63. %end if