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.

alertmanager.yml 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. global:
  2. # The smarthost and SMTP sender used for mail notifications.
  3. %if %%alSMTPUseSys == 'oui'
  4. %if %%tls_smtp == "non"
  5. smtp_smarthost: '%%exim_relay_smtp:25'
  6. %elif %%tls_smtp == "port 25"
  7. smtp_smarthost: '%%exim_relay_smtp:25'
  8. smtp_require_tls: true
  9. %else
  10. smtp_smarthost: '%%exim_relay_smtp:465'
  11. smtp_require_tls: true
  12. %end if
  13. smtp_from: '%%system_mail_from'
  14. %else
  15. smtp_smarthost: '%%alSMTPHost:%%alSMTPPort'
  16. smtp_from: '%%alFrom'
  17. %if %%getVar('alSMTPAuth','non') == 'oui'
  18. smtp_auth_username: '%%alSMTPUser'
  19. smtp_auth_password: 'alSMTPPass'
  20. %end if
  21. %if %%getVar('alSMTPTLS','non') == 'oui'
  22. smtp_require_tls: true
  23. %else
  24. smtp_require_tls: false
  25. %end if
  26. %end if
  27. # The auth token for Hipchat.
  28. #hipchat_auth_token: '1234556789'
  29. # Alternative host for Hipchat.
  30. #hipchat_api_url: 'https://hipchat.foobar.org/'
  31. # The directory from which notification templates are read.
  32. templates:
  33. - '/etc/alertmanager/template/*.tmpl'
  34. # The root route on which each incoming alert enters.
  35. route:
  36. # The labels by which incoming alerts are grouped together. For example,
  37. # multiple alerts coming in for cluster=A and alertname=LatencyHigh would
  38. # be batched into a single group.
  39. group_by: ['alertname', 'cluster', 'service']
  40. # When a new group of alerts is created by an incoming alert, wait at
  41. # least 'group_wait' to send the initial notification.
  42. # This way ensures that you get multiple alerts for the same group that start
  43. # firing shortly after another are batched together on the first
  44. # notification.
  45. group_wait: 30s
  46. # When the first notification was sent, wait 'group_interval' to send a batch
  47. # of new alerts that started firing for that group.
  48. group_interval: 5m
  49. # If an alert has successfully been sent, wait 'repeat_interval' to
  50. # resend them.
  51. repeat_interval: 3h
  52. # A default receiver
  53. receiver: %%alDefaultReceiver
  54. # All the above attributes are inherited by all child routes and can
  55. # overwritten on each.
  56. # The child route trees.
  57. routes:
  58. # This routes performs a regular expression match on alert labels to
  59. # catch alerts that are related to a list of services.
  60. %for route in %%getVar('alRouteRegxp',[])
  61. - match_re:
  62. %%{route.alRouteMatchRegExpSource}: %%{route.alRouteMatchRegExp}
  63. receiver: %%route.alRouteMatchRegxpRecv
  64. %if not %%is_empty('alSubRoute')
  65. routes:
  66. %for sroute in %%getVar('alSubRoute',[])
  67. # The service has a sub-route for critical alerts, any alerts
  68. # that do not match, i.e. severity != critical, fall-back to the
  69. # parent node and are sent to 'team-X-mails'
  70. %if %%sroute == %%route
  71. - match:
  72. %%{sroute.alSubRouteMatchSource}: %%alSubRouteMatchValue
  73. receiver: %%alSubRouteMatchReceiver
  74. %end if
  75. %end for
  76. %end if
  77. %end for
  78. %for rt in %%getVar('alRoute',[])
  79. - match:
  80. %%{rt.alRouteMatchSource}: %%{rt.alRouteMatchValue}
  81. receiver: %%rt.alRouteMatchReceiver
  82. %if not %%is_empty('alSubRoute')
  83. routes:
  84. %for sroute in %%getVar('alSubRoute',[])
  85. %if %%sroute == %%rt
  86. - match:
  87. %%{sroute.alSubRouteMatchSource}: %%{sroute.alSubRouteMatchValue}
  88. receiver: %%sroute.alSubRouteMatchReceiver
  89. %end if
  90. %end for
  91. %end if
  92. %end for
  93. # # This route handles all alerts coming from a database service. If there's
  94. # # no team to handle it, it defaults to the DB team.
  95. # - match:
  96. # service: database
  97. # receiver: team-DB-pager
  98. # # Also group alerts by affected database.
  99. # group_by: [alertname, cluster, database]
  100. # routes:
  101. # - match:
  102. # owner: team-X
  103. # receiver: team-X-pager
  104. # - match:
  105. # owner: team-Y
  106. # receiver: team-Y-pager
  107. # Inhibition rules allow to mute a set of alerts given that another alert is
  108. # firing.
  109. # We use this to mute any warning-level notifications if the same alert is
  110. # already critical.
  111. inhibit_rules:
  112. - source_match:
  113. severity: 'critical'
  114. target_match:
  115. severity: 'warning'
  116. # Apply inhibition if the alertname is the same.
  117. equal: ['alertname', 'cluster', 'service']
  118. receivers:
  119. %for rcv in %%getVar('alReceiver',[])
  120. - name: '%%rcv'
  121. email_configs:
  122. - to: '%%rcv.alReceiverEmail'
  123. %end for