一.prometheus告警
prometheus有了监控和展示后,我们可以看到各种指标,但没有告警的话还是不方便。
(1)alertmanager告警
1.下载安装
下载地址:Download | Prometheus
tar -xvf alertmanager-0.20.0.linux-amd64.tar.gz
alertnatives –version
启动
./alertmanager –config.file=simple.yml
后台启动
nohup ./alertmanager &
2.编辑Prometheus配置文件prometheus.yml,并添加以下内容:
1 alerting: 2 alertmanagers: 3 - static_configs: 4 targets: ['localhost:9093'] 5 6 rule_files: 7 8 -"/usr/local/alertmanager_rules.yml" #报警规则邮件
3.编写alertmanager.yml文件
global:
resolve_timeout: 5m
wechat_api_corp_id: “ww8b888888”
wechat_api_url: “https://qyapi.weixin.qq.com/cgi-bin”
wechat_api_secret: “FTzXYrR123123dsf”
templates:
– 'template/*.tmpl'
route:
group_by: ['alertname'] # 报警分组依据
© 版权声明
文章版权归作者所有,未经允许请勿转载。如内容涉嫌侵权,请在本页底部进入<联系我们>进行举报投诉!
THE END
暂无评论内容