mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 13:44:08 +01:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa8f43132c | ||
|
|
3f693feefc | ||
|
|
bc32b7d084 | ||
|
|
f7f6a646a0 | ||
|
|
b755497062 | ||
|
|
656bca02cd | ||
|
|
da0c7f9a03 | ||
|
|
b8d7832145 | ||
|
|
a4d7d833b7 | ||
|
|
24b3239e9f | ||
|
|
ac5a09361a | ||
|
|
179b39e7d5 | ||
|
|
22db6d79a7 | ||
|
|
f725b59c5c |
60
CHANGELOG.md
60
CHANGELOG.md
@@ -1,3 +1,63 @@
|
|||||||
|
## 3.0.10 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for restore script not taking "custom" usernames or passwords
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.9 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Switch to using parallel versions of compression tools all the time, yet explicitly state the threads in use (1 or ++)
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.8 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add PARALLEL_COMPRESSION_THREADS environment variable to limit amount of threads when compressing - Currently autodetects however many processors are avaialable to the container
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.7 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Reverted
|
||||||
|
- Strip unused LOG directives
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.6 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for parallel compression
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.5 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Add more detail regarding manual modes
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.4 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for 3.0.3
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.3 2022-03-21 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Add documentation for Manual mode
|
||||||
|
- Revert Compression variables
|
||||||
|
|
||||||
|
|
||||||
|
## 3.0.2 2022-03-18 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Cleanup of Zabbix Agent options
|
||||||
|
- Updated Zabbix template
|
||||||
|
- Split apart S3 options for better debugging and also cleaned up their variables
|
||||||
|
- Fixed issue with post scripts not outputting proper backup start time
|
||||||
|
- Cleaned up some notifications
|
||||||
|
- Rearranged code
|
||||||
|
|
||||||
|
|
||||||
## 3.0.1 2022-03-17 <dave at tiredofit dot ca>
|
## 3.0.1 2022-03-17 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -47,10 +47,15 @@ Currently backs up CouchDB, InfluxDB, MySQL, MongoDB, Postgres, Redis servers.
|
|||||||
- [Persistent Storage](#persistent-storage-1)
|
- [Persistent Storage](#persistent-storage-1)
|
||||||
- [Environment Variables](#environment-variables)
|
- [Environment Variables](#environment-variables)
|
||||||
- [Base Images used](#base-images-used)
|
- [Base Images used](#base-images-used)
|
||||||
|
- [Container Options](#container-options)
|
||||||
|
- [Database Specific Options](#database-specific-options)
|
||||||
|
- [Scheduling Options](#scheduling-options)
|
||||||
|
- [Backup Options](#backup-options)
|
||||||
- [Backing Up to S3 Compatible Services](#backing-up-to-s3-compatible-services)
|
- [Backing Up to S3 Compatible Services](#backing-up-to-s3-compatible-services)
|
||||||
- [Maintenance](#maintenance)
|
- [Maintenance](#maintenance)
|
||||||
- [Shell Access](#shell-access)
|
- [Shell Access](#shell-access)
|
||||||
- [Manual Backups](#manual-backups)
|
- [Manual Backups](#manual-backups)
|
||||||
|
- [Restoring Databases](#restoring-databases)
|
||||||
- [Custom Scripts](#custom-scripts)
|
- [Custom Scripts](#custom-scripts)
|
||||||
- [Support](#support)
|
- [Support](#support)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
@@ -120,6 +125,7 @@ Be sure to view the following repositories to understand all the customizable op
|
|||||||
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | --------------- |
|
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | --------------- |
|
||||||
| `BACKUP_LOCATION` | Backup to `FILESYSTEM` or `S3` compatible services like S3, Minio, Wasabi | `FILESYSTEM` |
|
| `BACKUP_LOCATION` | Backup to `FILESYSTEM` or `S3` compatible services like S3, Minio, Wasabi | `FILESYSTEM` |
|
||||||
| `MODE` | `AUTO` mode to use internal scheduling routines or `MANUAL` to simply use this as manual backups only executed by your own means | `AUTO` |
|
| `MODE` | `AUTO` mode to use internal scheduling routines or `MANUAL` to simply use this as manual backups only executed by your own means | `AUTO` |
|
||||||
|
| `MANUAL_RUN_FOREVER` | `TRUE` or `FALSE` if you wish to try to make the container exit after the backup | `TRUE` |
|
||||||
| `TEMP_LOCATION` | Perform Backups and Compression in this temporary directory | `/tmp/backups/` |
|
| `TEMP_LOCATION` | Perform Backups and Compression in this temporary directory | `/tmp/backups/` |
|
||||||
| `DB_AUTH` | (Mongo Only - Optional) Authentication Database | |
|
| `DB_AUTH` | (Mongo Only - Optional) Authentication Database | |
|
||||||
| `DEBUG_MODE` | If set to `true`, print copious shell script messages to the container log. Otherwise only basic messages are printed. | `FALSE` |
|
| `DEBUG_MODE` | If set to `true`, print copious shell script messages to the container log. Otherwise only basic messages are printed. | `FALSE` |
|
||||||
@@ -148,15 +154,17 @@ Be sure to view the following repositories to understand all the customizable op
|
|||||||
### Backup Options
|
### Backup Options
|
||||||
| Parameter | Description | Default |
|
| Parameter | Description | Default |
|
||||||
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------- |
|
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||||
| `ENABLE_COMPRESSION` | Use either Gzip `GZ`, Bzip2 `BZ`, XZip `XZ`, ZSTD `ZSTD` or none `NONE` | `GZ` |
|
| `COMPRESSION` | Use either Gzip `GZ`, Bzip2 `BZ`, XZip `XZ`, ZSTD `ZSTD` or none `NONE` | `GZ` |
|
||||||
| `ENABLE_PARALLEL_COMPRESSION` | Use multiple cores when compressing backups `TRUE` or `FALSE` | `TRUE` |
|
|
||||||
| `COMPRESSION_LEVEL` | Numberical value of what level of compression to use, most allow `1` to `9` except for `ZSTD` which allows for `1` to `19` - | `3` |
|
| `COMPRESSION_LEVEL` | Numberical value of what level of compression to use, most allow `1` to `9` except for `ZSTD` which allows for `1` to `19` - | `3` |
|
||||||
|
| `ENABLE_PARALLEL_COMPRESSION` | Use multiple cores when compressing backups `TRUE` or `FALSE` | `TRUE` |
|
||||||
|
| `PARALLEL_COMPRESSION_THREADS` | Maximum amount of threads to use when compressing - Integer value e.g. `8` | `autodetected` |
|
||||||
| `ENABLE_CHECKSUM` | Generate either a MD5 or SHA1 in Directory, `TRUE` or `FALSE` | `TRUE` |
|
| `ENABLE_CHECKSUM` | Generate either a MD5 or SHA1 in Directory, `TRUE` or `FALSE` | `TRUE` |
|
||||||
| `CHECKSUM` | Either `MD5` or `SHA1` | `MD5` |
|
| `CHECKSUM` | Either `MD5` or `SHA1` | `MD5` |
|
||||||
| `EXTRA_OPTS` | If you need to pass extra arguments to the backup command, add them here e.g. `--extra-command` | |
|
| `EXTRA_OPTS` | If you need to pass extra arguments to the backup command, add them here e.g. `--extra-command` | |
|
||||||
| `MYSQL_MAX_ALLOWED_PACKET` | Max allowed packet if backing up MySQL / MariaDB | `512M` |
|
| `MYSQL_MAX_ALLOWED_PACKET` | Max allowed packet if backing up MySQL / MariaDB | `512M` |
|
||||||
| `MYSQL_SINGLE_TRANSACTION` | Backup in a single transaction with MySQL / MariaDB | `TRUE` |
|
| `MYSQL_SINGLE_TRANSACTION` | Backup in a single transaction with MySQL / MariaDB | `TRUE` |
|
||||||
| `MYSQL_STORED_PROCEDURES` | Backup stored procedures with MySQL / MariaDB | `TRUE` |
|
| `MYSQL_STORED_PROCEDURES` | Backup stored procedures with MySQL / MariaDB | `TRUE` |
|
||||||
|
|
||||||
- When using compression with MongoDB, only `GZ` compression is possible.
|
- When using compression with MongoDB, only `GZ` compression is possible.
|
||||||
|
|
||||||
#### Backing Up to S3 Compatible Services
|
#### Backing Up to S3 Compatible Services
|
||||||
@@ -190,6 +198,8 @@ docker exec -it (whatever your container name is) bash
|
|||||||
### Manual Backups
|
### Manual Backups
|
||||||
Manual Backups can be performed by entering the container and typing `backup-now`
|
Manual Backups can be performed by entering the container and typing `backup-now`
|
||||||
|
|
||||||
|
- Recently there was a request to have the container work with Kukbernetes cron scheduling. This can theoretically be accomplished by setting the container `MODE=MANUAL` and then setting `MANUAL_RUN_FOREVER=FALSE` - You would also want to disable a few features from the upstream base images specifically `CONTAINER_ENABLE_SCHEDULING` and `CONTAINER_ENABLE_MONITORING`. This should allow the container to start, execute a backup by executing and then exit cleanly. An alternative way to running the script is to execute `/etc/services.available/10-db-backup/run`.
|
||||||
|
|
||||||
### Restoring Databases
|
### Restoring Databases
|
||||||
Entering in the container and executing `restore` will execute a menu based script to restore your backups.
|
Entering in the container and executing `restore` will execute a menu based script to restore your backups.
|
||||||
|
|
||||||
|
|||||||
@@ -2,20 +2,19 @@
|
|||||||
|
|
||||||
BACKUP_LOCATION=${BACKUP_LOCATION:-"FILESYSTEM"}
|
BACKUP_LOCATION=${BACKUP_LOCATION:-"FILESYSTEM"}
|
||||||
CHECKSUM=${CHECKSUM:-"MD5"}
|
CHECKSUM=${CHECKSUM:-"MD5"}
|
||||||
|
COMPRESSION=${COMPRESSION:-"GZ"}
|
||||||
COMPRESSION_LEVEL=${COMPRESSION_LEVEL:-"3"}
|
COMPRESSION_LEVEL=${COMPRESSION_LEVEL:-"3"}
|
||||||
DB_DUMP_BEGIN=${DB_DUMP_BEGIN:-+0}
|
DB_DUMP_BEGIN=${DB_DUMP_BEGIN:-+0}
|
||||||
DB_DUMP_FREQ=${DB_DUMP_FREQ:-1440}
|
DB_DUMP_FREQ=${DB_DUMP_FREQ:-1440}
|
||||||
DB_DUMP_TARGET=${DB_DUMP_TARGET:-"/backup"}
|
DB_DUMP_TARGET=${DB_DUMP_TARGET:-"/backup"}
|
||||||
ENABLE_CHECKSUM=${ENABLE_CHECKSUM:-"TRUE"}
|
ENABLE_CHECKSUM=${ENABLE_CHECKSUM:-"TRUE"}
|
||||||
ENABLE_COMPRESSION=${ENABLE_COMPRESSION:-"GZ"}
|
ENABLE_PARALLEL_COMPRESSION=${ENABLE_PARALLEL_COMPRESSION}:-"TRUE"}
|
||||||
ENABLE_PARALLEL_COMPRESSION={ENABLE_PARALLEL_COMPRESSION:-"TRUE"}
|
|
||||||
LOG_PATH=${LOG_PATH:-"/logs/"}
|
|
||||||
LOG_TYPE=${LOG_TYPE:-"BOTH"}
|
|
||||||
MANUAL_RUN_FOREVER=${MANUAL_RUN_FOREVER:-"TRUE"}
|
MANUAL_RUN_FOREVER=${MANUAL_RUN_FOREVER:-"TRUE"}
|
||||||
MODE=${MODE:-"AUTO"}
|
MODE=${MODE:-"AUTO"}
|
||||||
MYSQL_MAX_ALLOWED_PACKET=${MYSQL_MAX_ALLOWED_PACKET:-"512M"}
|
MYSQL_MAX_ALLOWED_PACKET=${MYSQL_MAX_ALLOWED_PACKET:-"512M"}
|
||||||
MYSQL_SINGLE_TRANSACTION=${MYSQL_SINGLE_TRANSACTION:-"TRUE"}
|
MYSQL_SINGLE_TRANSACTION=${MYSQL_SINGLE_TRANSACTION:-"TRUE"}
|
||||||
MYSQL_STORED_PROCEDURES=${MYSQL_STORED_PROCEDURES:-"TRUE"}
|
MYSQL_STORED_PROCEDURES=${MYSQL_STORED_PROCEDURES:-"TRUE"}
|
||||||
|
PARALLEL_COMPRESSION_THREADS=${PARALLEL_COMPRESSION_THREADS:-"$(nproc)"}
|
||||||
S3_CERT_SKIP_VERIFY=${S3_CERT_SKIP_VERIFY:-"TRUE"}
|
S3_CERT_SKIP_VERIFY=${S3_CERT_SKIP_VERIFY:-"TRUE"}
|
||||||
S3_PROTOCOL=${S3_PROTOCOL:-"https"}
|
S3_PROTOCOL=${S3_PROTOCOL:-"https"}
|
||||||
SIZE_VALUE=${SIZE_VALUE:-"bytes"}
|
SIZE_VALUE=${SIZE_VALUE:-"bytes"}
|
||||||
|
|||||||
@@ -3,15 +3,17 @@
|
|||||||
bootstrap_compression() {
|
bootstrap_compression() {
|
||||||
### Set Compression Options
|
### Set Compression Options
|
||||||
if var_true "${ENABLE_PARALLEL_COMPRESSION}" ; then
|
if var_true "${ENABLE_PARALLEL_COMPRESSION}" ; then
|
||||||
bzip="pbzip2 -${COMPRESSION_LEVEL}"
|
print_debug "Utilizing '${PARALLEL_COMPRESSION_THREADS}' compression threads"
|
||||||
gzip="pigz -${COMPRESSION_LEVEL}"
|
bzip="pbzip2 -${COMPRESSION_LEVEL} -p ${PARALLEL_COMPRESSION_THREADS}"
|
||||||
xzip="pixz -${COMPRESSION_LEVEL}"
|
gzip="pigz -${COMPRESSION_LEVEL} -p ${PARALLEL_COMPRESSION_THREADS}"
|
||||||
zstd="zstd --rm -${COMPRESSION_LEVEL}"
|
xzip="pixz -${COMPRESSION_LEVEL} -p ${PARALLEL_COMPRESSION_THREADS}"
|
||||||
|
zstd="zstd --rm -${COMPRESSION_LEVEL} -T${PARALLEL_COMPRESSION_THREADS}"
|
||||||
else
|
else
|
||||||
bzip="bzip2 -${COMPRESSION_LEVEL}"
|
print_debug "Utilizing single compression thread"
|
||||||
gzip="gzip -${COMPRESSION_LEVEL}"
|
bzip="pbzip2 -${COMPRESSION_LEVEL} -p 1"
|
||||||
xzip="xz -${COMPRESSION_LEVEL} "
|
gzip="pigz -${COMPRESSION_LEVEL} -p 1"
|
||||||
zstd="zstd --rm -${COMPRESSION_LEVEL}"
|
xzip="pixz -${COMPRESSION_LEVEL} -p 1"
|
||||||
|
zstd="zstd --rm -${COMPRESSION_LEVEL} -T1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,14 +334,13 @@ check_exit_code() {
|
|||||||
print_info "Backup completed successfully"
|
print_info "Backup completed successfully"
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
print_error "Backup reported errors - Aborting"
|
print_error "Backup reported errors"
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
compression() {
|
compression() {
|
||||||
case "${ENABLE_COMPRESSION,,}" in
|
case "${COMPRESSION,,}" in
|
||||||
gz* )
|
gz* )
|
||||||
print_notice "Compressing backup with gzip"
|
print_notice "Compressing backup with gzip"
|
||||||
target=${target}.gz
|
target=${target}.gz
|
||||||
@@ -422,17 +423,18 @@ move_backup() {
|
|||||||
export AWS_DEFAULT_REGION=${S3_REGION}
|
export AWS_DEFAULT_REGION=${S3_REGION}
|
||||||
if [ -f "${S3_CERT_CA_FILE}" ] ; then
|
if [ -f "${S3_CERT_CA_FILE}" ] ; then
|
||||||
print_debug "Using Custom CA for S3 Backups"
|
print_debug "Using Custom CA for S3 Backups"
|
||||||
s3_ssl=" --ca-bundle ${S3_CERT_CA_FILE}"
|
s3_ca_cert="--ca-bundle ${S3_CERT_CA_FILE}"
|
||||||
fi
|
fi
|
||||||
if var_true "${S3_CERT_SKIP_VERIFY}" ; then
|
if var_true "${S3_CERT_SKIP_VERIFY}" ; then
|
||||||
print_debug "Skipping SSL verification for HTTPS S3 Hosts"
|
print_debug "Skipping SSL verification for HTTPS S3 Hosts"
|
||||||
s3_ssl="${s3_ssl} --no-verify-ssl"
|
s3_ssl="--no-verify-ssl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ ( -n "${S3_HOST}" ) ]] && PARAM_AWS_ENDPOINT_URL=" --endpoint-url ${S3_PROTOCOL}://${S3_HOST}"
|
[[ ( -n "${S3_HOST}" ) ]] && PARAM_AWS_ENDPOINT_URL=" --endpoint-url ${S3_PROTOCOL}://${S3_HOST}"
|
||||||
|
|
||||||
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${TEMP_LOCATION}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target} ${s3_ssl} ${S3_EXTRA_OPTS}
|
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${TEMP_LOCATION}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target} ${s3_ssl} ${s3_ca_cert} ${S3_EXTRA_OPTS}
|
||||||
|
unset s3_ssl
|
||||||
|
unset s3_ca_cert
|
||||||
rm -rf "${TEMP_LOCATION}"/*."${checksum_extension}"
|
rm -rf "${TEMP_LOCATION}"/*."${checksum_extension}"
|
||||||
rm -rf "${TEMP_LOCATION}"/"${target}"
|
rm -rf "${TEMP_LOCATION}"/"${target}"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -5,6 +5,14 @@ source /assets/functions/10-db-backup
|
|||||||
source /assets/defaults/10-db-backup
|
source /assets/defaults/10-db-backup
|
||||||
PROCESS_NAME="db-backup"
|
PROCESS_NAME="db-backup"
|
||||||
|
|
||||||
|
bootstrap_compression
|
||||||
|
bootstrap_variables
|
||||||
|
|
||||||
|
if [ "${MODE,,}" = "manual" ] ; then
|
||||||
|
DB_DUMP_BEGIN=+0
|
||||||
|
manual=TRUE
|
||||||
|
fi
|
||||||
|
|
||||||
case "${1,,}" in
|
case "${1,,}" in
|
||||||
"now" | "manual" )
|
"now" | "manual" )
|
||||||
DB_DUMP_BEGIN=+0
|
DB_DUMP_BEGIN=+0
|
||||||
@@ -15,9 +23,6 @@ case "${1,,}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
bootstrap_compression
|
|
||||||
bootstrap_variables
|
|
||||||
|
|
||||||
### Container Startup
|
### Container Startup
|
||||||
print_debug "Backup routines Initialized on $(date)"
|
print_debug "Backup routines Initialized on $(date)"
|
||||||
|
|
||||||
@@ -27,6 +32,7 @@ case "${1,,}" in
|
|||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
|
if [ "${manual,,}" = "true" ]; then
|
||||||
current_time=$(date +"%s")
|
current_time=$(date +"%s")
|
||||||
today=$(date +"%Y%m%d")
|
today=$(date +"%Y%m%d")
|
||||||
|
|
||||||
@@ -43,6 +49,7 @@ case "${1,,}" in
|
|||||||
print_debug "Wait Time: ${waittime} Target time: ${target_time} Current Time: ${current_time}"
|
print_debug "Wait Time: ${waittime} Target time: ${target_time} Current Time: ${current_time}"
|
||||||
print_info "Next Backup at $(date -d @${target_time} +"%Y-%m-%d %T %Z")"
|
print_info "Next Backup at $(date -d @${target_time} +"%Y-%m-%d %T %Z")"
|
||||||
sleep $waittime
|
sleep $waittime
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -94,15 +101,15 @@ while true; do
|
|||||||
backup_finish_time=$(date +"%s")
|
backup_finish_time=$(date +"%s")
|
||||||
backup_total_time=$(echo $((backup_finish_time-backup_start_time)))
|
backup_total_time=$(echo $((backup_finish_time-backup_start_time)))
|
||||||
|
|
||||||
print_info "Backup finish time: $(date -d @${backup_finish_time} +"%Y-%m-%d %T %Z")"
|
print_info "Backup finish time: $(date -d @${backup_finish_time} +"%Y-%m-%d %T %Z") with exit code ${exit_code}"
|
||||||
print_notice "Backup time elapsed: $(echo ${backup_total_time} | awk '{printf "Hours: *%d* Minutes: *%02d* Seconds: *%02d*", $1/3600, ($1/60)%60, $1%60}')"
|
print_notice "Backup time elapsed: $(echo ${backup_total_time} | awk '{printf "Hours: %d Minutes: %02d Seconds: %02d", $1/3600, ($1/60)%60, $1%60}')"
|
||||||
|
|
||||||
### Zabbix / Monitoring stats
|
### Zabbix / Monitoring stats
|
||||||
if var_true "${CONTAINER_ENABLE_MONITORING}" ; then
|
if var_true "${CONTAINER_ENABLE_MONITORING}" ; then
|
||||||
print_notice "Sending Backup Statistics to Zabbix"
|
print_notice "Sending Backup Statistics to Zabbix"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.size -o "$(stat -c%s "${DB_DUMP_TARGET}"/"${target}")"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.size -o "$(stat -c%s "${DB_DUMP_TARGET}"/"${target}")"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.datetime -o "$(date -r "${DB_DUMP_TARGET}"/"${target}" +'%s')"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.datetime -o "$(date -r "${DB_DUMP_TARGET}"/"${target}" +'%s')"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.status -o "$(date -r "${DB_DUMP_TARGET}"/"${target}" +'%s')"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.status -o "${exit_code}"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.backup_duration -o "$(echo $((backup_finish_time-backup_start_time)))"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.backup_duration -o "$(echo $((backup_finish_time-backup_start_time)))"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -116,7 +123,7 @@ while true; do
|
|||||||
### Post Script Support
|
### Post Script Support
|
||||||
if [ -n "${POST_SCRIPT}" ] ; then
|
if [ -n "${POST_SCRIPT}" ] ; then
|
||||||
print_notice "Found POST_SCRIPT environment variable. Executing '${POST_SCRIPT}"
|
print_notice "Found POST_SCRIPT environment variable. Executing '${POST_SCRIPT}"
|
||||||
eval "${POST_SCRIPT}" "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_start_timme}" "${backup_finish_time}" "${backup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
|
eval "${POST_SCRIPT}" "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_start_time}" "${backup_finish_time}" "${backup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Post Backup Custom Script Support
|
### Post Backup Custom Script Support
|
||||||
@@ -125,7 +132,7 @@ while true; do
|
|||||||
for f in $(find /assets/custom-scripts/ -name \*.sh -type f); do
|
for f in $(find /assets/custom-scripts/ -name \*.sh -type f); do
|
||||||
print_notice "Running Script: '${f}'"
|
print_notice "Running Script: '${f}'"
|
||||||
## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE
|
## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE
|
||||||
${f} "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_start_timme}" "${backup_finish_time}" "${backup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
|
${f} "${exit_code}" "${dbtype}" "${dbhost}" "${dbname}" "${backup_start_time}" "${backup_finish_time}" "${backup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -697,9 +697,9 @@ EOF
|
|||||||
c* )
|
c* )
|
||||||
counter=1
|
counter=1
|
||||||
q_dbuser=" "
|
q_dbuser=" "
|
||||||
while [[ $q_dbname = *" "* ]]; do
|
while [[ $q_dbuser = *" "* ]]; do
|
||||||
if [ $counter -gt 1 ] ; then print_error "DB Usernames can't have spaces in them, please re-enter." ; fi ;
|
if [ $counter -gt 1 ] ; then print_error "DB Usernames can't have spaces in them, please re-enter." ; fi ;
|
||||||
read -e -p "$(echo -e ${clg}** ${cdgy}What DB User do you wish to use:\ ${coff})" q_dbname
|
read -e -p "$(echo -e ${clg}** ${cdgy}What DB User do you wish to use:\ ${coff})" q_dbuser
|
||||||
(( counter+=1 ))
|
(( counter+=1 ))
|
||||||
done
|
done
|
||||||
r_dbuser=${q_dbuser}
|
r_dbuser=${q_dbuser}
|
||||||
@@ -766,9 +766,9 @@ EOF
|
|||||||
c* )
|
c* )
|
||||||
counter=1
|
counter=1
|
||||||
q_dbpass=" "
|
q_dbpass=" "
|
||||||
while [[ $q_dbname = *" "* ]]; do
|
while [[ $q_dbpass = *" "* ]]; do
|
||||||
if [ $counter -gt 1 ] ; then print_error "DB Passwords can't have spaces in them, please re-enter." ; fi ;
|
if [ $counter -gt 1 ] ; then print_error "DB Passwords can't have spaces in them, please re-enter." ; fi ;
|
||||||
read -e -p "$(echo -e ${clg}** ${cdgy}What DB Password do you wish to use:\ ${coff})" q_dbname
|
read -e -p "$(echo -e ${clg}** ${cdgy}What DB Password do you wish to use:\ ${coff})" q_dbpass
|
||||||
(( counter+=1 ))
|
(( counter+=1 ))
|
||||||
done
|
done
|
||||||
r_dbpass=${q_dbpass}
|
r_dbpass=${q_dbpass}
|
||||||
|
|||||||
249
zabbix_templates/db_backup.json
Normal file
249
zabbix_templates/db_backup.json
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
{
|
||||||
|
"zabbix_export": {
|
||||||
|
"version": "6.0",
|
||||||
|
"date": "2022-03-18T13:32:12Z",
|
||||||
|
"groups": [
|
||||||
|
{
|
||||||
|
"uuid": "fa56524b5dbb4ec09d9777a6f7ccfbe4",
|
||||||
|
"name": "DB/Backup"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "748ad4d098d447d492bb935c907f652f",
|
||||||
|
"name": "Templates/Databases"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"templates": [
|
||||||
|
{
|
||||||
|
"uuid": "5fc64d517afb4cc5bc09a3ef58b43ef7",
|
||||||
|
"template": "DB Backup",
|
||||||
|
"name": "DB Backup",
|
||||||
|
"description": "Template for Docker DB Backup Image\n\nMeant for use specifically with https://github.com/tiredofit/docker-db-backup\nLast tested with version 3.0.2",
|
||||||
|
"groups": [
|
||||||
|
{
|
||||||
|
"name": "DB/Backup"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Templates/Databases"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"uuid": "72fd00fa2dd24e479f5affe03e8711d8",
|
||||||
|
"name": "DB Backup: Backup Duration",
|
||||||
|
"type": "TRAP",
|
||||||
|
"key": "dbbackup.backup_duration",
|
||||||
|
"delay": "0",
|
||||||
|
"history": "7d",
|
||||||
|
"units": "uptime",
|
||||||
|
"description": "How long the backup took",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "Application",
|
||||||
|
"value": "DB Backup"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "3549a2c9d56849babc6dc3c855484c1e",
|
||||||
|
"name": "DB Backup: Backup Time",
|
||||||
|
"type": "TRAP",
|
||||||
|
"key": "dbbackup.datetime",
|
||||||
|
"delay": "0",
|
||||||
|
"history": "7d",
|
||||||
|
"units": "unixtime",
|
||||||
|
"request_method": "POST",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "Application",
|
||||||
|
"value": "DB Backup"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"uuid": "3ac1e074ffea46eb8002c9c08a85e7b4",
|
||||||
|
"expression": "nodata(/DB Backup/dbbackup.datetime,2d)=1",
|
||||||
|
"name": "DB-Backup: No backups detected in 2 days",
|
||||||
|
"priority": "DISASTER",
|
||||||
|
"manual_close": "YES"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "b8b5933dfa1a488c9c37dd7f4784c1ff",
|
||||||
|
"expression": "fuzzytime(/DB Backup/dbbackup.datetime,172800s)=0 and fuzzytime(/DB Backup/dbbackup.datetime,259200s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,345600s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,432800s)<>0",
|
||||||
|
"name": "DB Backup: No Backups occurred in 2 days",
|
||||||
|
"priority": "AVERAGE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "35c5f420d0e142cc9601bae38decdc40",
|
||||||
|
"expression": "fuzzytime(/DB Backup/dbbackup.datetime,172800s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,259200s)=0 and fuzzytime(/DB Backup/dbbackup.datetime,345600s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,432800s)<>0",
|
||||||
|
"name": "DB Backup: No Backups occurred in 3 days",
|
||||||
|
"priority": "AVERAGE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "03c3719d82c241e886a0383c7d908a77",
|
||||||
|
"expression": "fuzzytime(/DB Backup/dbbackup.datetime,172800s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,259200s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,345600s)=0 and fuzzytime(/DB Backup/dbbackup.datetime,432800s)<>0",
|
||||||
|
"name": "DB Backup: No Backups occurred in 4 days",
|
||||||
|
"priority": "AVERAGE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "1634a03e44964e42b7e0101f5f68499c",
|
||||||
|
"expression": "fuzzytime(/DB Backup/dbbackup.datetime,172800s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,259200s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,345600s)<>0 and fuzzytime(/DB Backup/dbbackup.datetime,432800s)=0",
|
||||||
|
"name": "DB Backup: No Backups occurred in 5 days or more",
|
||||||
|
"priority": "HIGH"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "467dfec952b34f5aa4cc890b4351b62d",
|
||||||
|
"name": "DB Backup: Backup Size",
|
||||||
|
"type": "TRAP",
|
||||||
|
"key": "dbbackup.size",
|
||||||
|
"delay": "0",
|
||||||
|
"history": "7d",
|
||||||
|
"units": "B",
|
||||||
|
"request_method": "POST",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "Application",
|
||||||
|
"value": "DB Backup"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"uuid": "a41eb49b8a3541afb6de247dca750e38",
|
||||||
|
"expression": "last(/DB Backup/dbbackup.size)/last(/DB Backup/dbbackup.size,#2)>1.2",
|
||||||
|
"name": "DB Backup: 20% Greater in Size",
|
||||||
|
"priority": "WARNING",
|
||||||
|
"manual_close": "YES"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "422f66be5049403293f3d96fc53f20cd",
|
||||||
|
"expression": "last(/DB Backup/dbbackup.size)/last(/DB Backup/dbbackup.size,#2)<0.2",
|
||||||
|
"name": "DB Backup: 20% Smaller in Size",
|
||||||
|
"priority": "WARNING",
|
||||||
|
"manual_close": "YES"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "d6d9d875b92f4d799d4bc89aabd4e90e",
|
||||||
|
"expression": "last(/DB Backup/dbbackup.size)<1K",
|
||||||
|
"name": "DB Backup: empty",
|
||||||
|
"priority": "HIGH"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "a6b13e8b46a64abab64a4d44d620d272",
|
||||||
|
"name": "DB Backup: Last Backup Status",
|
||||||
|
"type": "TRAP",
|
||||||
|
"key": "dbbackup.status",
|
||||||
|
"delay": "0",
|
||||||
|
"history": "7d",
|
||||||
|
"description": "Maps Exit Codes received by backup applications",
|
||||||
|
"valuemap": {
|
||||||
|
"name": "DB Backup Status"
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "Application",
|
||||||
|
"value": "DB Backup"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"uuid": "23d71e356f96493180f02d4b84a79fd6",
|
||||||
|
"expression": "last(/DB Backup/dbbackup.status)=1",
|
||||||
|
"name": "DB Backup: Failed Backup Detected",
|
||||||
|
"priority": "HIGH",
|
||||||
|
"manual_close": "YES"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "Service",
|
||||||
|
"value": "Backup"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "Service",
|
||||||
|
"value": "Database"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dashboards": [
|
||||||
|
{
|
||||||
|
"uuid": "90c81bb47184401ca9663626784a6f30",
|
||||||
|
"name": "DB Backup",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"widgets": [
|
||||||
|
{
|
||||||
|
"type": "GRAPH_CLASSIC",
|
||||||
|
"name": "Backup Size",
|
||||||
|
"width": "23",
|
||||||
|
"height": "5",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"type": "GRAPH",
|
||||||
|
"name": "graphid",
|
||||||
|
"value": {
|
||||||
|
"name": "DB Backup: Backup Size",
|
||||||
|
"host": "DB Backup"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"valuemaps": [
|
||||||
|
{
|
||||||
|
"uuid": "82f3a3d01b3c42b8942b59d2363724e0",
|
||||||
|
"name": "DB Backup Status",
|
||||||
|
"mappings": [
|
||||||
|
{
|
||||||
|
"value": "0",
|
||||||
|
"newvalue": "OK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "GREATER_OR_EQUAL",
|
||||||
|
"value": "1",
|
||||||
|
"newvalue": "FAIL"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"graphs": [
|
||||||
|
{
|
||||||
|
"uuid": "6e02c200b76046bab76062cd1ab086b2",
|
||||||
|
"name": "DB Backup: Backup Duration",
|
||||||
|
"graph_items": [
|
||||||
|
{
|
||||||
|
"color": "199C0D",
|
||||||
|
"item": {
|
||||||
|
"host": "DB Backup",
|
||||||
|
"key": "dbbackup.backup_duration"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "b881ee18f05c4f4c835982c9dfbb55d6",
|
||||||
|
"name": "DB Backup: Backup Size",
|
||||||
|
"type": "STACKED",
|
||||||
|
"graph_items": [
|
||||||
|
{
|
||||||
|
"sortorder": "1",
|
||||||
|
"color": "1A7C11",
|
||||||
|
"item": {
|
||||||
|
"host": "DB Backup",
|
||||||
|
"key": "dbbackup.size"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,270 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<zabbix_export>
|
|
||||||
<version>3.4</version>
|
|
||||||
<date>2018-02-02T19:03:49Z</date>
|
|
||||||
<groups>
|
|
||||||
<group>
|
|
||||||
<name>DB - Backup</name>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<name>Templates</name>
|
|
||||||
</group>
|
|
||||||
</groups>
|
|
||||||
<templates>
|
|
||||||
<template>
|
|
||||||
<template>Service - DB Backup</template>
|
|
||||||
<name>Service - DB Backup</name>
|
|
||||||
<description/>
|
|
||||||
<groups>
|
|
||||||
<group>
|
|
||||||
<name>DB - Backup</name>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<name>Templates</name>
|
|
||||||
</group>
|
|
||||||
</groups>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>DB Backup</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<items>
|
|
||||||
<item>
|
|
||||||
<name>Backup Time</name>
|
|
||||||
<type>2</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>dbbackup.datetime</key>
|
|
||||||
<delay>0</delay>
|
|
||||||
<history>365d</history>
|
|
||||||
<trends>365d</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>3</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units>unixtime</units>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>DB Backup</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<name>Backup Size</name>
|
|
||||||
<type>2</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>dbbackup.size</key>
|
|
||||||
<delay>0</delay>
|
|
||||||
<history>365d</history>
|
|
||||||
<trends>365d</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>3</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units>byte</units>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>DB Backup</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
</items>
|
|
||||||
<discovery_rules/>
|
|
||||||
<httptests/>
|
|
||||||
<macros/>
|
|
||||||
<templates/>
|
|
||||||
<screens/>
|
|
||||||
</template>
|
|
||||||
</templates>
|
|
||||||
<triggers>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - DB Backup:dbbackup.size.change()}>20</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>DB Backup is 20% Greater in Size</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>2</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>1</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - DB Backup:dbbackup.size.change()}<20</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>DB Backup is 20% Smaller in Size</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>2</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>1</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - DB Backup:dbbackup.size.last()}<1K</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>DB Backup is empty</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>4</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - DB Backup:dbbackup.datetime.fuzzytime(172800)}=0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(259200)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(345600)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(432800)}<>0</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>No Backups occurred in 2 days</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>3</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - DB Backup:dbbackup.datetime.fuzzytime(172800)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(259200)}=0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(345600)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(432800)}<>0</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>No Backups occurred in 3 days</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>3</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - DB Backup:dbbackup.datetime.fuzzytime(172800)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(259200)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(345600)}=0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(432800)}<>0</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>No Backups occurred in 4 days</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>3</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - DB Backup:dbbackup.datetime.fuzzytime(172800)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(259200)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(345600)}<>0 and {Service - DB Backup:dbbackup.datetime.fuzzytime(432800)}=0</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>No Backups occurred in 5 days or more</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>4</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
</triggers>
|
|
||||||
<graphs>
|
|
||||||
<graph>
|
|
||||||
<name>Backup Size</name>
|
|
||||||
<width>900</width>
|
|
||||||
<height>200</height>
|
|
||||||
<yaxismin>0.0000</yaxismin>
|
|
||||||
<yaxismax>100.0000</yaxismax>
|
|
||||||
<show_work_period>1</show_work_period>
|
|
||||||
<show_triggers>1</show_triggers>
|
|
||||||
<type>1</type>
|
|
||||||
<show_legend>1</show_legend>
|
|
||||||
<show_3d>0</show_3d>
|
|
||||||
<percent_left>0.0000</percent_left>
|
|
||||||
<percent_right>0.0000</percent_right>
|
|
||||||
<ymin_type_1>0</ymin_type_1>
|
|
||||||
<ymax_type_1>0</ymax_type_1>
|
|
||||||
<ymin_item_1>0</ymin_item_1>
|
|
||||||
<ymax_item_1>0</ymax_item_1>
|
|
||||||
<graph_items>
|
|
||||||
<graph_item>
|
|
||||||
<sortorder>0</sortorder>
|
|
||||||
<drawtype>0</drawtype>
|
|
||||||
<color>1A7C11</color>
|
|
||||||
<yaxisside>0</yaxisside>
|
|
||||||
<calc_fnc>2</calc_fnc>
|
|
||||||
<type>0</type>
|
|
||||||
<item>
|
|
||||||
<host>Service - DB Backup</host>
|
|
||||||
<key>dbbackup.size</key>
|
|
||||||
</item>
|
|
||||||
</graph_item>
|
|
||||||
</graph_items>
|
|
||||||
</graph>
|
|
||||||
</graphs>
|
|
||||||
</zabbix_export>
|
|
||||||
Reference in New Issue
Block a user