当前位置:网站首页>Prometheus adds email alarm and enterprise wechat robot alarm
Prometheus adds email alarm and enterprise wechat robot alarm
2022-07-26 15:04:00 【kali_ yao】
We will be in Prometheus Write alert rules on the server , These rules will use the metrics we collect and trigger alerts at specified thresholds or criteria , After receiving the alarm , Alertmanager Alerts are processed and routed according to their tags . Once the path is determined , They will be made by Alertmanager Send to external destinations , E-mail 、 SMS or chat tool

Email alert ( Note that if you use qq Need to open smtp agreement )
~]# vim alertmanager.yml global: resolve_timeout: 5m smtp_smarthost: 'smtp.qq.com:465' # Mailbox url And port smtp_from: '[email protected]' # Send email smtp_auth_username: '[email protected]' # Send email smtp_auth_password: 'xxxxxxxxxxxx' # Authorization code ( It can also be called password ) smtp_require_tls: false smtp_hello: 'qq.com' templates: # Custom template - '/etc/alertmanager/template/*.tmpl' route: group_by: ['alertname','alarmPolicyName','version'] group_wait: 10s group_interval: 10s repeat_interval: 40m receiver: 'email' receivers: - name: 'email' email_configs: # Own mailbox - to: '[email protected]' html: '{ { template "email.html" . }}' headers: { Subject: "[WARN]CPU The alarm " } send_resolved: true
Enterprise wechat robot
1. Create the machine first
2. establish webhook service
apiVersion: apps/v1 kind: Deployment metadata: labels: run: prometheus-webhook-dingtalk name: prometheus-webhook-dingtalk namespace: kube-system spec: selector: matchLabels: run: prometheus-webhook-dingtalk template: metadata: labels: run: prometheus-webhook-dingtalk spec: containers: - args: - --adapter=/app/prometheusalert/wx.js=/adapter/wx=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={} # there key Press the just created image: registry.cn-hangzhou.aliyuncs.com/guyongquan/webhook-adapter name: prometheus-webhook-dingtalk ports: - containerPort: 80 protocol: TCP --- apiVersion: v1 kind: Service metadata: labels: run: prometheus-webhook-dingtalk name: prometheus-webhook-dingtalk namespace: kube-system spec: ports: - port: 8060 protocol: TCP targetPort: 80 selector: run: prometheus-webhook-dingtalk type: ClusterIP
3. Alarm mode writing
~]# vim alertmanager.yaml global: resolve_timeout: 5m templates: - '/etc/alertmanager/template/*.tmpl' route: group_by: ['alertname'] group_wait: 10s group_interval: 10s repeat_interval: 100m receiver: 'web.hook' receivers: - name: 'web.hook' webhook_configs: - url: 'http://prometheus-webhook-dingtalk.kube-system.svc.cluster.local:8060/adapter/wx' # Just created webhook Address send_resolved: false inhibit_rules: - source_match: severity: 'critical' target_match: severity: 'warning' equal: ['alertname', 'dev', 'instance']notes : When configuring the alarm of enterprise wechat robot, you need to install webhook; The last restart
4. see
边栏推荐
- What are the skills and methods of searching foreign literature
- 次轮Okaleido Tiger即将登录Binance NFT,引发社区热议
- Cve-2022-33891 Apache spark shell command injection vulnerability recurrence
- 9. Learn MySQL delete statement
- PyTorch中 torch.nn与torch.nn.functional的区别
- Where is the foreign literature needed to write the graduation thesis?
- JS to realize the number to amount price thousand separator
- Stacked noise reducing auto encoder (sdae)
- How to get 5L water in a full 10L container, 7L or 4L empty container
- SiamFC:用于目标跟踪的全卷积孪生网络
猜你喜欢

The difference between torch.nn and torch.nn.functional in pytorch

JS creative range select drag and drop plug-ins

Deep Packet Inspection Using Quotient Filter论文总结

最详细的专利申请教程,教你如何申请专利

Stacked noise reducing auto encoder (sdae)

双屏协作效率翻倍 灵耀X双屏Pro引领双屏科技新潮流

OpenGL学习日记2——着色器

CVE-2022-33891 Apache spark shell 命令注入漏洞复现

CVE-2022-33891漏洞复现

基于CAS的SSO单点客户端配置
随机推荐
leetcode汇总
Data permissions should be designed like this, yyyds!
Everything is available Cassandra: the fairy database behind Huawei tag
[Nuxt 3] (十二) 项目目录结构 1
postman 环境变量设置代码存放
[nuxt 3] (XII) project directory structure 1
基于CAS的SSO单点服务端配置
OSS deletes all files two days before the current time
Chuhuan technology is listed on Shenzhen Stock Exchange: Minsheng securities, with a market value of 2.7 billion, is a shareholder
JS creative range select drag and drop plug-ins
晋拓股份上交所上市:市值26亿 张东家族企业色彩浓厚
AMB | 迈向可持续农业:根际微生物工程
SharkTeam发布2022年第二季度Web3安全态势感知报告
Notes (5)
SiamRPN:建议区域网络与孪生网络
自编码器 AE(AutoEncoder)程序
Next generation visual transformer: Unlocking the correct combination of CNN and transformer
AMB | towards sustainable agriculture: rhizosphere microbial engineering
How to get 5L water in a full 10L container, 7L or 4L empty container
益方生物上市首日跌16%:公司市值88亿 高瓴与礼来是股东


