From a3fae84aeb73ccd6182b1469c83d754c225f3eb1 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Fri, 23 Aug 2024 20:58:53 +0800 Subject: [PATCH] fix: fix error. (#150) --- docs/guides/gettingStarted/admin.mdx | 41 ++++++++++++++++++- .../current/gettingStarted/admin.mdx | 38 ----------------- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/docs/guides/gettingStarted/admin.mdx b/docs/guides/gettingStarted/admin.mdx index 4d24d79b51..3d5f4fef64 100644 --- a/docs/guides/gettingStarted/admin.mdx +++ b/docs/guides/gettingStarted/admin.mdx @@ -101,6 +101,45 @@ docker compose 部署时,会自动部署如下组件,如使用源码部署 send_resolved: true # 告警解决时是否发送通知 ``` +5. 邮件模版文件 email.tmpl 说明:此文件是 html 格式,告警管理模块会填充里面的变量信息,然后渲染成 html 格式文件,进行邮件的发送,可根据需求自行改写: + + ```tmpl + {{ define "email.to.html" }} + {{ if eq .Status "firing" }} + {{ range .Alerts }} + +
+

OpenIM Alert

+

Alert Status: firing

+

Alert Program: Prometheus Alert

+

Severity Level: {{ .Labels.severity }}

+

Alert Type: {{ .Labels.alertname }}

+

Affected Host: {{ .Labels.instance }}

+

Affected Service: {{ .Labels.job }}

+

Alert Subject: {{ .Annotations.summary }}

+

Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}

+
+ {{ end }} + {{ else if eq .Status "resolved" }} + {{ range .Alerts }} + +
+

OpenIM Alert

+

Alert Status: resolved

+

Alert Program: Prometheus Alert

+

Severity Level: {{ .Labels.severity }}

+

Alert Type: {{ .Labels.alertname }}

+

Affected Host: {{ .Labels.instance }}

+

Affected Service: {{ .Labels.job }}

+

Alert Subject: {{ .Annotations.summary }}

+

Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}

+
+ {{ end }} + + {{ end }} + {{ end }} + ``` + ## 登录管理后台 在浏览器中输入 `http://ip:11002` 来访问管理后台。此 IP 为服务端 OPENIM_IP,确保您的浏览器能访问。默认账号和密码均为 chatAdmin @@ -223,4 +262,4 @@ rpc_count prometheus 容器没启动成功一般是两个原因: 1. 没有在`prometheus.yml`中配置内网 ip。 - 2. 第一次启动`prometheus`容器时可能会遇到权限问题,在`open-im-server`项目下运行`chmod -R 777 components`后重新启动容器即可。 + 2. 第一次启动`prometheus`容器时可能会遇到权限问题,在`open-im-server`项目下运行`chmod -R 777 components`后重新启动容器即可。 \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs-guides/current/gettingStarted/admin.mdx b/i18n/en/docusaurus-plugin-content-docs-guides/current/gettingStarted/admin.mdx index 937683d3dc..0a3634a357 100644 --- a/i18n/en/docusaurus-plugin-content-docs-guides/current/gettingStarted/admin.mdx +++ b/i18n/en/docusaurus-plugin-content-docs-guides/current/gettingStarted/admin.mdx @@ -101,44 +101,6 @@ When deploying with Docker Compose, the following components will be automatical send_resolved: true # Whether to send a notification when the alert is resolved ``` -5. **email.tmpl Template File Description**: This file is in HTML format. The alert management module will fill in the variable information and render it into an HTML file to send the email. You can modify it according to your needs: - - ```tmpl - {{ define "email.to.html" }} - {{ if eq .Status "firing" }} - {{ range .Alerts }} - -
-

OpenIM Alert

-

Alert Status: firing

-

Alert Program: Prometheus Alert

-

Severity Level: {{ .Labels.severity }}

-

Alert Type: {{ .Labels.alertname }}

-

Affected Host: {{ .Labels.instance }}

-

Affected Service: {{ .Labels.job }}

-

Alert Subject: {{ .Annotations.summary }}

-

Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}

-
- {{ end }} - {{ else if eq .Status "resolved" }} - {{ range .Alerts }} - -
-

OpenIM Alert

-

Alert Status: resolved

-

Alert Program: Prometheus Alert

-

Severity Level: {{ .Labels.severity }}

-

Alert Type: {{ .Labels.alertname }}

-

Affected Host: {{ .Labels.instance }}

-

Affected Service: {{ .Labels.job }}

-

Alert Subject: {{ .Annotations.summary }}

-

Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}

-
- {{ end }} - - {{ end }} - {{ end }} - ``` ## Accessing the Admin Panel