企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## 配置文件 rules/server-status.rules ``` groups: - name: server_control rules: - alert: server_status expr: upantbiz_server_up_time == 0 for: 1m labels: severity: page annotations: summary: "服务{{ $labels.server }}停止" description: "服务 {{ $labels.instance }} {{ $labels.server }} 停止 已经停机超过1分钟.请尽快处理" ``` ## 在 promethues.yml 中添加 ``` rule_files: - "rules/*.yaml" ``` 在 alertmanager.yml 中,添加 web_hook ``` route: group_by: ['alertname'] group_wait: 30s group_interval: 1m repeat_interval: 1h receiver: 'web.hook' receivers: - name: 'web.hook' webhook_configs: - url: 'http://127.0.0.1:8000/test.php' inhibit_rules: - source_match: severity: 'critical' target_match: severity: 'warning' equal: ['alertname', 'dev', 'instance'] ``` 重启 promethues ,并启动 alertmanager