
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
#!/bin/bash
# check_enhance_backup
# Author: Radoslav Stoimenov <radoslav.stoimenov@worldhost.group>
# Version 0.1

# Perform the check
backup_servers_count=$(/usr/bin/sudo -u postgres /usr/bin/psql -d orchd -t -c "SELECT COUNT(*) FROM servers WHERE backup = 1;" | tr -d '[:space:]')

if [[ $backup_servers_count != "0" ]]; then
    echo "[OK] - Backup server/s for cluster configured: $backup_servers_count"
    exit 0
else
    echo "[CRITICAL] - Backup server/s not configured."
    exit 2
fi
