diff --git a/zabbix-dump b/zabbix-dump index c17e6da..f8cee5c 100755 --- a/zabbix-dump +++ b/zabbix-dump @@ -278,6 +278,7 @@ case $DBTYPE in mysql) [ ! -z "$MYSQL_CONFIG" ] && DB_OPTS=("${DB_OPTS[@]}" --defaults-extra-file="$MYSQL_CONFIG") [ ! -z "$DBSOCKET" ] && DB_OPTS=("${DB_OPTS[@]}" -S $DBSOCKET) + [ ! -z "$DBHOST" ] && DB_OPTS=("${DB_OPTS[@]}" -h $DBHOST) [ ! -z "$DBUSER" ] && DB_OPTS=("${DB_OPTS[@]}" -u $DBUSER) [ ! -z "$DBPASS" ] && DB_OPTS=("${DB_OPTS[@]}" -p"$DBPASS") DB_OPTS=("${DB_OPTS[@]}" -P"$DBPORT") @@ -286,6 +287,7 @@ case $DBTYPE in ;; psql) [ ! -z "$DBSOCKET" ] && DB_OPTS=("${DB_OPTS[@]}" -h $DBSOCKET) + [ ! -z "$DBHOST" ] && DB_OPTS=("${DB_OPTS[@]}" -h $DBHOST) [ ! -z "$DBUSER" ] && DB_OPTS=("${DB_OPTS[@]}" -U $DBUSER) DB_OPTS=("${DB_OPTS[@]}" -p"$DBPORT") if [ ! -z "$DBPASS" ]; then @@ -297,7 +299,6 @@ case $DBTYPE in [ ! -z "$DBNAME" ] && DB_OPTS_BATCH=("${DB_OPTS_BATCH[@]}" -d $DBNAME) ;; esac -[ ! -z "$DBHOST" ] && DB_OPTS=("${DB_OPTS[@]}" -h $DBHOST) # Log file for errors ERRORLOG=$(mktemp)