This commit is contained in:
@@ -23,8 +23,10 @@
|
|||||||
|
|
||||||
1. 拉取代码
|
1. 拉取代码
|
||||||
|
|
||||||
|
> v4.9 版本往上 Helm 部署 Bug 异常多,暂时还是推荐使用 v4.9
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/feiyu563/PrometheusAlert.git
|
git clone --branch v4.9 https://github.com/feiyu563/PrometheusAlert.git
|
||||||
cd PrometheusAlert/example/helm
|
cd PrometheusAlert/example/helm
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -65,7 +67,15 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: true
|
||||||
|
hosts:
|
||||||
|
- host: # 域名
|
||||||
|
paths: ["/"]
|
||||||
|
|
||||||
|
tls:
|
||||||
|
- secretName: drone-tls
|
||||||
|
hosts:
|
||||||
|
- # 域名
|
||||||
```
|
```
|
||||||
|
|
||||||
5. 安装
|
5. 安装
|
||||||
@@ -76,6 +86,12 @@
|
|||||||
-f prometheusalert-values.yaml
|
-f prometheusalert-values.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
6. 通过 NodePort 或 Ingress 对外开放访问后登录密码为
|
||||||
|
|
||||||
|
账号:prometheusalert
|
||||||
|
|
||||||
|
密码:prometheusalert
|
||||||
|
|
||||||
## 卸载
|
## 卸载
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -119,4 +135,59 @@ helm uninstall prometheusalert -n monitor
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
```
|
```
|
||||||
|
|
||||||
- 保存模版
|
- **消息协议JSON内容**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"receiver": "webhook",
|
||||||
|
"status": "firing",
|
||||||
|
"alerts": [
|
||||||
|
{
|
||||||
|
"status": "resolved",
|
||||||
|
"labels": {
|
||||||
|
"alertname": "HighCPUUsage",
|
||||||
|
"level": "warning",
|
||||||
|
"instance": "192.168.1.10:9100"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"summary": "CPU使用率过高",
|
||||||
|
"value": "95%",
|
||||||
|
"description": "CPU使用率持续超过阈值90%达5分钟"
|
||||||
|
},
|
||||||
|
"startsAt": "2023-08-25T10:00:00Z",
|
||||||
|
"endsAt": "2023-08-25T10:05:00Z",
|
||||||
|
"generatorURL": "http://prometheus:9090/graph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"status": "firing",
|
||||||
|
"labels": {
|
||||||
|
"alertname": "DiskFull",
|
||||||
|
"level": "critical",
|
||||||
|
"instance": "192.168.1.11:9100"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"summary": "磁盘空间不足",
|
||||||
|
"value": "98%",
|
||||||
|
"description": "/data分区使用率超过95%"
|
||||||
|
},
|
||||||
|
"startsAt": "2023-08-25T10:03:00Z",
|
||||||
|
"endsAt": "0001-01-01T00:00:00Z",
|
||||||
|
"generatorURL": "http://prometheus:9090/graph"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"groupLabels": {
|
||||||
|
"alertname": "instance"
|
||||||
|
},
|
||||||
|
"commonLabels": {
|
||||||
|
"job": "node_exporter"
|
||||||
|
},
|
||||||
|
"commonAnnotations": {},
|
||||||
|
"externalURL": "http://alertmanager:9093",
|
||||||
|
"version": "4",
|
||||||
|
"groupKey": "{}:{alertname=\"instance\"}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 模板测试
|
||||||
|
|
||||||
|
- 模板保存
|
||||||
|
Reference in New Issue
Block a user