ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的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