mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
suspend remote dns if connection failed
This commit is contained in:
parent
bbc652c331
commit
f70ba768a3
9 changed files with 85 additions and 74 deletions
|
@ -52,9 +52,10 @@ fi
|
|||
old_ifs="$IFS"
|
||||
IFS=$'\n'
|
||||
|
||||
# Starting cluster loop
|
||||
for cluster_str in $(cat $VESTA/conf/dns-cluster.conf); do
|
||||
# Check remote dns nodes
|
||||
remote_dns_health_check
|
||||
|
||||
for cluster_str in $(grep "SUSPENDED='no'" $VESTA/conf/dns-cluster.conf); do
|
||||
# Get host values
|
||||
eval $cluster_str
|
||||
|
||||
|
@ -69,24 +70,10 @@ for cluster_str in $(cat $VESTA/conf/dns-cluster.conf); do
|
|||
*) send_cmd="send_api_cmd" ;;
|
||||
esac
|
||||
|
||||
# Check host connection
|
||||
$send_cmd v-list-sys-config
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: $TYPE connection to $HOST failed"
|
||||
log_event "$E_CONNECT $EVENT"
|
||||
exit $E_CONNECT
|
||||
fi
|
||||
|
||||
# Check recipient dns user
|
||||
if [ -z "$DNS_USER" ]; then
|
||||
DNS_USER='dns-cluster'
|
||||
fi
|
||||
$send_cmd v-list-user $DNS_USER
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: dns user $DNS_USER doesn't exist"
|
||||
log_event "$E_NOTEXIST $EVENT"
|
||||
exit $E_NOTEXIST
|
||||
fi
|
||||
|
||||
# Check dns exceptions
|
||||
if [ -z "$DNS_CLUSTER_IGNORE" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue