当前位置:网站首页>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
边栏推荐
- [nuxt 3] (XII) project directory structure 1
- SA-Siam:用于实时目标跟踪的孪生网络
- [2022 national game simulation] Bai Loujian - Sam, rollback Mo team, second offline
- Minecraft 1.16.5模组开发(五十二) 修改原版生物战利品 (Loot Table)
- jmeter分布式
- 关于工控网关物联网串口转WiFi模块与串口转网口模块的选型
- Character function and string function and memory function
- Leetcode summary
- C common function integration
- 怎样在nature上查文献?
猜你喜欢

Chuhuan technology is listed on Shenzhen Stock Exchange: Minsheng securities, with a market value of 2.7 billion, is a shareholder

RPN: region proposal networks

How to find undergraduate dissertations of domestic universities?

Crystal special decoration submitted for registration: the first quarter revenue fell by 80%, and Chen Bo controlled 68.5% of the equity

下一代视觉Transformer:解锁CNN和Transformer正确结合方法

JS creative range select drag and drop plug-ins

OpenGL学习日记2——着色器

Siamrpn++: evolution of deep network connected visual tracking

4 kinds of round head arrangement styles overlay styles

Classic line style login interface
随机推荐
李宏毅《机器学习》丨3. Gradient Descent(梯度下降)
PyTorch中 nn.Conv2d与nn.ConvTranspose2d函数的用法
js 实现数字转金额价格千分符
Minecraft 1.16.5 module development (52) modify the original biological trophy (lot table)
The IPO of shengtaier technology was terminated: it was planned to raise 560million yuan, and Qiming and Jifeng capital were shareholders
AMB | 迈向可持续农业:根际微生物工程
Cve-2022-33891 vulnerability recurrence
Ner of NLP: Exploration and practice of product title attribute recognition
Deep Packet Inspection Using Quotient Filter论文总结
php反序列化部分学习
固态硬盘对游戏运行的帮助有多少
基于CAS的SSO单点客户端配置
Okaleido tiger is about to log in to binance NFT in the second round, which has aroused heated discussion in the community
How to find the translation of foreign literature for undergraduate graduation thesis?
外文文献查找技巧方法有哪些
有哪些科研人员看文献必用的软件?
Create root permission virtual environment
1.两数之和
生泰尔科技IPO被终止:曾拟募资5.6亿 启明与济峰资本是股东
哪里有写毕业论文需要的外文文献?


