配置报警规则
Alertmanager部署
https://prometheus.io/download/
安装alertmanager
[root@prometheus ~]# tar xf alertmanager-0.20.0-rc.0.linux-amd64.tar.gz -C /usr/local/
[root@prometheus ~]# ln -sv /usr/local/alertmanager-0.20.0-rc.0.linux-amd64/ /usr/local/Prometheus_alertmanager/
[root@prometheus ~]# cd /usr/local/Prometheus_alertmanager/
配置alertmanager邮件告警
[root@prometheus Prometheus_alertmanager]# cp alertmanager.yml alertmanager.yml.bak
[root@prometheus Prometheus_alertmanager]# vim alertmanager.yml
global:
resolve_timeout: 5m
smtp_smarthost: 'smtp.163.com:25' # smtp地址
smtp_from: 'xxx@163.com' # 谁发邮件
smtp_auth_username: 'xxx@163.com'