V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
lib64
/
nagios
/
plugins
/
Viewing: check_a2_omni_mysql_backup.sh
#!/bin/bash # # mysql_backup_check.sh a bash script that checks if the backup of databases defined in $MONITORED_DB were successful # it monitors mysql backups that are created by /opt/bin/mysql_backup.sh script # REF: SYSENG-23785 # author: mfranczak@a2hosting.com # Comma separated list of the backups of databases we want to monitor. MONITORED_DB="omni,supersekrit,mysql,information_schema" # Backup location BACKUP_LOCATION="/opt/backup/" FAILED_BCKP='' # Set the Internal Field Separator (IFS) to a comma IFS=',' # Convert the variable into an array read -ra DBS <<< "$MONITORED_DB" # Loop through the array of monitored DBs and echo each value separately for DB in "${DBS[@]}"; do ERROR=$(find "${BACKUP_LOCATION}" -type f -name ".backup_failed_${DB}" | wc -l) # Alert if backup number is 0 if [ "${ERROR}" != "0" ]; then if [ -z "${FAILED_BCKP}" ]; then FAILED_BCKP="${DB}" else FAILED_BCKP="${FAILED_BCKP}, ${DB}" fi fi done if [ -z "${FAILED_BCKP}" ]; then echo "check_a2_omni_mysql_backup.sh - mysql backups successful" exit 0 else echo "check_a2_omni_mysql_backup.sh - backup of the database ${FAILED_BCKP} failed" exit 2 fi
Coded With 💗 by
HanzOFC