做网站 做推广需要知道什么,个人建网站的费用,百度推广退款电话,简约的网站vmalert通过在alert.rules中配置告警规则实现告警#xff0c;告警规则语法与Prometheus兼容#xff0c;依赖Alertmanager与prometheus-webhook-dingtalk实现钉钉告警#xff0c;以下步骤#xff1a;
1、构建vmalert
从源代码构建vmalert#xff1a;
git clone https://…vmalert通过在alert.rules中配置告警规则实现告警告警规则语法与Prometheus兼容依赖Alertmanager与prometheus-webhook-dingtalk实现钉钉告警以下步骤
1、构建vmalert
从源代码构建vmalert
git clone https://github.com/VictoriaMetrics/VictoriaMetrics
cd VictoriaMetrics
make vmalert
构建二进制文件将放置在VictoriaMetrics/bin文件夹中。
2、添加alert.rules
告警规则语法兼容Prometheus
vim alert.rules#rule示例
groups:- name: test-rulerules:- alert: 主机状态expr: up 0for: 2mlabels:status: warningannotations:summary: {{$labels.instance}}:服务器关闭description: {{$labels.instance}}:服务器关闭
3、修改钉钉prometheus-webhook-dingtalk配置文件
vim /usr/local/prometheus-webhook-dingtalk/config.example.yml 4、修改alertmanager配置文件
#查看prometheus-webhook-dingtalk的url地址altermanager会将通知像这个地址发送
journalctl -u prometheus-webhook-dingtalk -f#可以看到url urlshttp://localhost:8060/dingtalk/webhook1/sendvim /usr/local/alertmanager/alertmanager.yml 5、启动vmalert
./bin/vmalert -rulealert.rules \-datasource.urlhttp://localhost:8428 \-notifier.urlhttp://localhost:9093
6、查看钉钉告警