Prometheus+Altermanager钉钉报警
2019-11-23 11:41
363 查看
Prometheus+Altermanager钉钉报警
一、添加钉钉机器人
参考钉钉官方文档:https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq
二、在k8s上部署钉钉告警deployment,这里我们引用第三方的插件。
[root@cn-hongkong webhook-dingtalk]# cat webhook-dingtalk.yaml apiVersion: apps/v1beta2 kind: Deployment metadata: labels: app: webhook-dingtalk name: webhook-dingtalk namespace: monitoring #需要和alertmanager在同一个namespace spec: replicas: 1 selector: matchLabels: app: webhook-dingtalk template: metadata: labels: app: webhook-dingtalk spec: containers: - image: billy98/webhook-dingtalk:latest name: webhook-dingtalk args: - "https://oapi.dingtalk.com/robot/send?access_token=1fd59067ab85bea575122a5e4f05cefd6609d9d3e41a725e46a90c2fad9b3" #上面创建的钉钉机器人hook ports: - containerPort: 8080 protocol: TCP resources: requests: cpu: 100m memory: 100Mi limits: cpu: 500m memory: 500Mi livenessProbe: failureThreshold: 3 initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 tcpSocket: port: 8080 readinessProbe: failureThreshold: 3 initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 httpGet: port: 8080 path: / imagePullSecrets: - name: IfNotPresent --- apiVersion: v1 kind: Service metadata: labels: app: webhook-dingtalk name: webhook-dingtalk namespace: monitoring #需要和alertmanager在同一个namespace spec: ports: - name: http port: 80 protocol: TCP targetPort: 8080 selector: app: webhook-dingtalk type: ClusterIP
三、alertmanager添加钉钉告警类型
config: global: resolve_timeout: 5m route: group_by: ['job','severity'] group_wait: 30s group_interval: 5m repeat_interval: 12h receiver: default receiver: webhook routes: - match: filesystem: node receiver: webhook receivers: - name: webhook webhook_configs: - url: http://webhook-dingtalk/dingtalk/send/ send_resolved: true
四、查看告警信息
相关文章推荐
- 几种主板BIOS报警声音的含义
- 关于仓库报警
- 怎样操作FC-236/238/2316报警主机
- ASP.NET 2.0中使用AJAX实现弹窗报警提示
- 消防报警预算实例(含图、计算稿等整套)
- asp.net 2.0 ajax中实现弹出窗口报警提示
- FreeBSD下解决Nagios不发报警邮件的问题
- 网站运维之道 监控与报警机制
- AWARD BIOS报警声详解
- solarwind设置手机短信报警
- 使用Perl实现系统服务监控和报警
- 网站运维之道 监控与报警机制
- 在Cacti上实现MSN报警机制
- cacti组件安装-实时报警
- W110报警协议 w110 协议
- Nagios飞信linux系统免费短信报警配置
- 关闭vmware喇叭报警声
- nagios监控linux主机、web等各种服务,并实现飞信自动报警
- nagios利用fetion发送报警 推荐
- CACTI实现短信报警的三种方法