真强大!prometheus配置企业微信告警

安装好prometheus和alertmanager后,可在prometheus.yml文件里添加告警策略文件。

1、在rule_files,加载/usr/local/prometheus/rules.yml文件。

真强大!prometheus配置企业微信告警

2、在rule.yml配置告警策略

真强大!prometheus配置企业微信告警

3、在alertmanager.yml配置告警对象,配置为企业微信:

wechat_api_corp_id:从微信公众号的企业微信获取,在企业微信,企业应用-》基础应用-》创建第三方应用,可查看到应用ID。

wechat_api_url: https://qyapi.weixin.qq.com/cgi-bin/

wechat_api_secret:企业微信ID

真强大!prometheus配置企业微信告警

真强大!prometheus配置企业微信告警

4、告警效果:

真强大!prometheus配置企业微信告警