Skip to content

Commit

Permalink
fix: solve error (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et authored Aug 23, 2024
1 parent 0d13c35 commit 5e2d860
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions docs/guides/gettingStarted/admin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,45 +101,6 @@ docker compose 部署时,会自动部署如下组件,如使用源码部署
send_resolved: true # 告警解决时是否发送通知
```

5. 邮件模版文件 email.tmpl 说明:此文件是 html 格式,告警管理模块会填充里面的变量信息,然后渲染成 html 格式文件,进行邮件的发送,可根据需求自行改写:

```tmpl
{{ define "email.to.html" }}
{{ if eq .Status "firing" }}
{{ range .Alerts }}
<!-- Begin of OpenIM Alert -->
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
<h3>OpenIM Alert</h3>
<p><strong>Alert Status:</strong> firing</p>
<p><strong>Alert Program:</strong> Prometheus Alert</p>
<p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
<p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
<p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
<p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
<p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
<p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
</div>
{{ end }}
{{ else if eq .Status "resolved" }}
{{ range .Alerts }}
<!-- Begin of OpenIM Alert -->
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
<h3>OpenIM Alert</h3>
<p><strong>Alert Status:</strong> resolved</p>
<p><strong>Alert Program:</strong> Prometheus Alert</p>
<p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
<p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
<p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
<p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
<p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
<p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
</div>
{{ end }}
<!-- End of OpenIM Alert -->
{{ end }}
{{ end }}
```

## 登录管理后台

在浏览器中输入 `http://ip:11002` 来访问管理后台。此 IP 为服务端 OPENIM_IP,确保您的浏览器能访问。默认账号和密码均为 chatAdmin
Expand Down

0 comments on commit 5e2d860

Please sign in to comment.