sunetdrive/templates/mariadb_backup/check_replication.erb
2023-03-10 10:05:21 +01:00

11 lines
290 B
Plaintext
Executable file

#!/bin/bash
result="$(docker exec mariadb_backup_mariadb_backup_1 mysql -p<%= @mysql_root_password %> -BN -e 'show status like "slave_running"')"
if [[ "${result}" == "Slave_running ON" ]]; then
echo "OK: Replica running"
exit 0
else
echo "CRITICAL: Replica not running"
exit 2
fi