[Watchdog] Watch milter status with a dirty workaround, waiting for proxy ping pong event to implement a better check
parent
f28d9ff7a6
commit
769c500cd0
|
@ -707,13 +707,20 @@ rspamd_checks() {
|
|||
From: watchdog@localhost
|
||||
|
||||
Empty
|
||||
' | usr/bin/curl -s --data-binary @- --unix-socket /var/lib/rspamd/rspamd.sock http://rspamd/scan | jq -rc .default.required_score)
|
||||
' | usr/bin/curl --max-time 10 -s --data-binary @- --unix-socket /var/lib/rspamd/rspamd.sock http://rspamd/scan | jq -rc .default.required_score)
|
||||
if [[ ${SCORE} != "9999" ]]; then
|
||||
echo "Rspamd settings check failed" 2>> /tmp/rspamd-mailcow 1>&2
|
||||
err_count=$(( ${err_count} + 1))
|
||||
else
|
||||
echo "Rspamd settings check succeeded" 2>> /tmp/rspamd-mailcow 1>&2
|
||||
fi
|
||||
# A dirty hack until a PING PONG event is implemented to worker proxy
|
||||
# We expect an empty response, not a timeout
|
||||
if [ "$(curl -s --max-time 10 ${host_ip}:9900 2> /dev/null ; echo $?)" == "28" ]; then
|
||||
echo "Milter check failed" 2>> /tmp/rspamd-mailcow 1>&2; err_count=$(( ${err_count} + 1 ));
|
||||
else
|
||||
echo "Milter check succeeded" 2>> /tmp/rspamd-mailcow 1>&2
|
||||
fi
|
||||
[ ${err_c_cur} -eq ${err_count} ] && [ ! $((${err_count} - 1)) -lt 0 ] && err_count=$((${err_count} - 1)) diff_c=1
|
||||
[ ${err_c_cur} -ne ${err_count} ] && diff_c=$(( ${err_c_cur} - ${err_count} ))
|
||||
progress "Rspamd" ${THRESHOLD} $(( ${THRESHOLD} - ${err_count} )) ${diff_c}
|
||||
|
|
|
@ -401,7 +401,7 @@ services:
|
|||
- /lib/modules:/lib/modules:ro
|
||||
|
||||
watchdog-mailcow:
|
||||
image: mailcow/watchdog:1.84
|
||||
image: mailcow/watchdog:1.85
|
||||
# Debug
|
||||
#command: /watchdog.sh
|
||||
dns:
|
||||
|
|
Loading…
Reference in New Issue