Zabbix port override settings fix
use OPT var prefix for options add missing init in functions init
This commit is contained in:
@@ -163,9 +163,11 @@ ZABBIX_DUMP_BIN="";
|
|||||||
ZABBIX_CONFIG="";
|
ZABBIX_CONFIG="";
|
||||||
ZABBIX_DATABASE="";
|
ZABBIX_DATABASE="";
|
||||||
ZABBIX_UNKNOWN_TABLES="";
|
ZABBIX_UNKNOWN_TABLES="";
|
||||||
|
ZABBIX_DB_PORT="";
|
||||||
OPT_ZABBIX_DUMP="";
|
OPT_ZABBIX_DUMP="";
|
||||||
OPT_ZABBIX_CONFIG="";
|
OPT_ZABBIX_CONFIG="";
|
||||||
OPT_ZABBIX_UNKNOWN_TABLES="";
|
OPT_ZABBIX_UNKNOWN_TABLES="";
|
||||||
|
OPT_ZABBIX_DB_PORT="";
|
||||||
# default keep 7 days, 4 weeks, 6 months, 1 year
|
# default keep 7 days, 4 weeks, 6 months, 1 year
|
||||||
# if set 0, ignore/off
|
# if set 0, ignore/off
|
||||||
# note that for last/hourly it is needed to create a different
|
# note that for last/hourly it is needed to create a different
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ fi;
|
|||||||
if [ "${ZABBIX_DATABASE}" = "psql" ]; then
|
if [ "${ZABBIX_DATABASE}" = "psql" ]; then
|
||||||
OPT_ZABBIX_DUMP="-C";
|
OPT_ZABBIX_DUMP="-C";
|
||||||
fi;
|
fi;
|
||||||
ZABBIX_DB_PORT="";
|
OPT_ZABBIX_DB_PORT="";
|
||||||
if [ -n "${ZABBIX_DB_PORT}" ]; then
|
if [ -n "${ZABBIX_DB_PORT}" ]; then
|
||||||
ZABBIX_DB_PORT="-P 5432";
|
OPT_ZABBIX_DB_PORT="-P ${ZABBIX_DB_PORT}";
|
||||||
fi;
|
fi;
|
||||||
if [ "${ZABBIX_DATABASE}" != "psql" ] && [ "${ZABBIX_DATABASE}" != "mysql" ]; then
|
if [ "${ZABBIX_DATABASE}" != "psql" ] && [ "${ZABBIX_DATABASE}" != "mysql" ]; then
|
||||||
echo "[! $(date +'%F %T')] Zabbix dump must have database set to either psql or mysql";
|
echo "[! $(date +'%F %T')] Zabbix dump must have database set to either psql or mysql";
|
||||||
@@ -74,13 +74,13 @@ fi;
|
|||||||
|
|
||||||
printf "${PRINTF_SUB_BLOCK}" "BACKUP: zabbix settings" "$(date +'%F %T')" "${MODULE}";
|
printf "${PRINTF_SUB_BLOCK}" "BACKUP: zabbix settings" "$(date +'%F %T')" "${MODULE}";
|
||||||
if [ ${DEBUG} -eq 1 ] || [ ${DRYRUN} -eq 1 ]; then
|
if [ ${DEBUG} -eq 1 ] || [ ${DRYRUN} -eq 1 ]; then
|
||||||
echo "${ZABBIX_DUMP_BIN} ${ZABBIX_DB_PORT} -t ${ZABBIX_DATABASE} ${OPT_ZABBIX_UNKNOWN_TABLES} ${OPT_ZABBIX_DUMP} ${OPT_ZABBIX_CONFIG} -o - | ${BORG_CALL}"
|
echo "${ZABBIX_DUMP_BIN} ${OPT_ZABBIX_DB_PORT} -t ${ZABBIX_DATABASE} ${OPT_ZABBIX_UNKNOWN_TABLES} ${OPT_ZABBIX_DUMP} ${OPT_ZABBIX_CONFIG} -o - | ${BORG_CALL}"
|
||||||
if [ -z "${ONE_TIME_TAG}" ]; then
|
if [ -z "${ONE_TIME_TAG}" ]; then
|
||||||
echo "${BORG_PRUNE}";
|
echo "${BORG_PRUNE}";
|
||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
if [ ${DRYRUN} -eq 0 ]; then
|
if [ ${DRYRUN} -eq 0 ]; then
|
||||||
${ZABBIX_DUMP_BIN} ${ZABBIX_DB_PORT} -t ${ZABBIX_DATABASE} ${OPT_ZABBIX_UNKNOWN_TABLES} ${OPT_ZABBIX_DUMP} ${OPT_ZABBIX_CONFIG} -o - | ${BORG_CALL};
|
${ZABBIX_DUMP_BIN} ${OPT_ZABBIX_DB_PORT} -t ${ZABBIX_DATABASE} ${OPT_ZABBIX_UNKNOWN_TABLES} ${OPT_ZABBIX_DUMP} ${OPT_ZABBIX_CONFIG} -o - | ${BORG_CALL};
|
||||||
fi;
|
fi;
|
||||||
if [ -z "${ONE_TIME_TAG}" ]; then
|
if [ -z "${ONE_TIME_TAG}" ]; then
|
||||||
printf "${PRINTF_SUB_BLOCK}" "PRUNE" "$(date +'%F %T')" "${MODULE}";
|
printf "${PRINTF_SUB_BLOCK}" "PRUNE" "$(date +'%F %T')" "${MODULE}";
|
||||||
|
|||||||
Reference in New Issue
Block a user