我有一个包含Alerts.yml和config.yml文件的Prometheus文件夹。规则存在于警报,yml文件中,并在Prometheus UI上正常触发。我有一个单独的'alertmanager'文件夹,其中包含config.ym
文件,其内容如下:
global:
smtp_smarthost: 'abc.com:25'
smtp_from: 'no-reply@abc.com'
require_tls: false
route:
receiver: alert-emailer
group_by: ['alertname', 'priority']
group_wait: 10s
repeat_interval: 2m
receivers:
- name: 'alert-emailer'
email_configs:
- to: 'xyz@abc.com'
Alerts are getting triggered however I am not receiving any email.
This is what the Prometheus config file looks like:
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
rule_files:
- 'alerts.yml'
alerting:
alertmanagers:
- scheme: http
static_configs:
- targets:
- "alertmanager:9093"
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['prometheus:9090']
...
我错过任何一步了吗?我是第一次这样做,因此请让我知道是否还有其他我可能错过的明显步骤。