Page Menu
Home
WMGMC Issues
搜索
Configure Global Search
登录
Files
F15903
repl_health.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
订阅
标记用于日后
授予令牌
Size
970 B
Referenced Files
None
订阅者
None
repl_health.sh
View Options
#!/bin/bash
source
/source_env.sh
# Do not attempt to write to slave
if
[[
!
-z
${
REDIS_SLAVEOF_IP
}
]]
;
then
REDIS_CMDLINE
=
"redis-cli -h
${
REDIS_SLAVEOF_IP
}
-p
${
REDIS_SLAVEOF_PORT
}
-a
${
REDISPASS
}
--no-auth-warning"
else
REDIS_CMDLINE
=
"redis-cli -h redis -p 6379 -a
${
REDISPASS
}
--no-auth-warning"
fi
# Is replication active?
# grep on file is less expensive than doveconf
if
[
-n
${
MAILCOW_REPLICA_IP
}
]
;
then
${
REDIS_CMDLINE
}
SET
DOVECOT_REPL_HEALTH
1
>
/dev/null
exit
fi
FAILED_SYNCS
=
$(
doveadm
replicator
status
|
grep
"Waiting 'failed' requests"
|
grep
-oE
'[0-9]+'
)
# Set amount of failed jobs as DOVECOT_REPL_HEALTH
# 1 failed job for mailcow.local is expected and healthy
if
[[
"
${
FAILED_SYNCS
}
"
!
=
0
]]
&&
[[
"
${
FAILED_SYNCS
}
"
!
=
1
]]
;
then
printf
"Dovecot replicator has %d failed jobs\n"
"
${
FAILED_SYNCS
}
"
${
REDIS_CMDLINE
}
SET
DOVECOT_REPL_HEALTH
"
${
FAILED_SYNCS
}
"
>
/dev/null
else
${
REDIS_CMDLINE
}
SET
DOVECOT_REPL_HEALTH
1
>
/dev/null
fi
File Metadata
详情
附加的
Mime Type
text/x-shellscript
Expires
9月 9 Tue, 5:48 AM (10 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5182
默认替代文本
repl_health.sh (970 B)
Attached To
Mode
rMAILCOW mailcow-tracking
附加的
Detach File
Event Timeline
Log In to Comment