From 0404b5195af35a98539ac6c42324e2da892a9540 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Thu, 5 Jan 2023 15:39:05 +0800 Subject: [PATCH] fix(notify): update MYSQL_OUT_OF_SYNC template (#15706) --- .../content@cn/MYSQL_OUT_OF_SYNC.tmpl | 18 +++++++++++++++++- .../content@en/MYSQL_OUT_OF_SYNC.tmpl | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/build/notify/root/opt/yunion/share/local-templates/content@cn/MYSQL_OUT_OF_SYNC.tmpl b/build/notify/root/opt/yunion/share/local-templates/content@cn/MYSQL_OUT_OF_SYNC.tmpl index 890d898dca..4c1ee71c72 100644 --- a/build/notify/root/opt/yunion/share/local-templates/content@cn/MYSQL_OUT_OF_SYNC.tmpl +++ b/build/notify/root/opt/yunion/share/local-templates/content@cn/MYSQL_OUT_OF_SYNC.tmpl @@ -1,2 +1,18 @@ {{- $d := .resource_details -}} -数据库 {{$d.ip}} 的主从同步不一致,请及时检查。 \ No newline at end of file +数据库 {{$d.ip}} 的主从同步不一致,请及时检查。 + +{{ range $status := $d.status }} +数据库 {{$status.ip}} 状态: +{{- if not $status.operator_error }} + - Slave_IO_Running: {{$status.slave_io_running}} + - Slave_SQL_Running: {{$status.slave_sql_running}} + {{- if $status.last_error }} + - Last_Error: {{$status.last_error}} + {{- end -}} + {{- if $status.last_io_error }} + - Last_IO_Error: {{$status.last_io_error}} + {{- end }} +{{else}} + - Operator_Error: {{$status.operator_error}} +{{- end}} +{{end}} diff --git a/build/notify/root/opt/yunion/share/local-templates/content@en/MYSQL_OUT_OF_SYNC.tmpl b/build/notify/root/opt/yunion/share/local-templates/content@en/MYSQL_OUT_OF_SYNC.tmpl index 89b5725302..8e17aa29f5 100644 --- a/build/notify/root/opt/yunion/share/local-templates/content@en/MYSQL_OUT_OF_SYNC.tmpl +++ b/build/notify/root/opt/yunion/share/local-templates/content@en/MYSQL_OUT_OF_SYNC.tmpl @@ -1,2 +1,18 @@ {{- $d := .resource_details -}} -The primary and secondary synchronization of the database ({{ $d.ip }}) is inconsistent, please check in time. \ No newline at end of file +The primary and secondary synchronization of the database ({{ $d.ip }}) is inconsistent, please check in time. + +{{ range $status := $d.status }} +Database {{$status.ip}} status: +{{- if not $status.operator_error }} + - Slave_IO_Running: {{$status.slave_io_running}} + - Slave_SQL_Running: {{$status.slave_sql_running}} + {{- if $status.last_error }} + - Last_Error: {{$status.last_error}} + {{- end -}} + {{- if $status.last_io_error }} + - Last_IO_Error: {{$status.last_io_error}} + {{- end }} +{{else}} + - Operator_Error: {{$status.operator_error}} +{{- end}} +{{end}}