From 2760dba480083977d179f095f47f28ec1913b9ec Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 11 Dec 2019 21:14:03 +0100 Subject: Properly detect MySQL/slave desynchronization --- adei/check_adei.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'adei/check_adei.sh') diff --git a/adei/check_adei.sh b/adei/check_adei.sh index 58ce49c..06047b6 100755 --- a/adei/check_adei.sh +++ b/adei/check_adei.sh @@ -40,9 +40,9 @@ fi # Verify offset (for selected database) if [ -n "$adei10" -a $healthy -ne 0 -a -n "$adei_source" ]; then now=$(date +%s) - sdate="$(adei_text_query "getdata.php?db_mask=0&format=csv&window=-1&rt=1&cache=1&time_format=U&mysql=slave")"; err_slave=$? + sdate="$(adei_text_query "getdata.php?db_mask=0&format=csv&window=-1&rt=1&cache=1&time_format=U" slave)"; err_slave=$? [ $err_slave -eq 0 ] && sdate="$(echo "$sdate" | cut -d ',' -f 1 | cut -d '.' -f 1)" - mdate="$(adei_text_query "getdata.php?db_mask=0&format=csv&window=-1&rt=1&cache=1&time_format=U&mysql=master")"; err_master=$? + mdate="$(adei_text_query "getdata.php?db_mask=0&format=csv&window=-1&rt=1&cache=1&time_format=U" master)"; err_master=$? [ $err_master -eq 0 ] && mdate="$(echo "$mdate" | cut -d ',' -f 1 | cut -d '.' -f 1)" src="$adei_source" @@ -62,7 +62,7 @@ if [ -n "$adei10" -a $healthy -ne 0 -a -n "$adei_source" ]; then slave_offset=$(($mdate - $sdate)) if [ $master_offset -gt $MAX_SOURCE_OFFSET ]; then - rdate=$(adei_text_query "getdata.php?db_mask=0&format=csv&window=-1&rt=1&time_format=U&mysql=master"); err=$? + rdate=$(adei_text_query "getdata.php?db_mask=0&format=csv&window=-1&rt=1&time_format=U" master); err=$? if [ $err -eq 0 ]; then rdate="$(echo "$rdate" | cut -d ',' -f 1 | cut -d '.' -f 1)" cache_offset=$(($rdate - $mdate)) -- cgit v1.2.3