diff --git a/global/overlay/etc/puppet/modules/net/files/baas2_restoretest/baas2-check-restore-status b/global/overlay/etc/puppet/modules/net/files/baas2_restoretest/baas2-check-restore-status new file mode 100644 index 0000000..0e9b5b3 --- /dev/null +++ b/global/overlay/etc/puppet/modules/net/files/baas2_restoretest/baas2-check-restore-status @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +status_file=/opt/baas2/validate-backup-status +nrpe_ok=0 +nrpe_critical=2 + +if ! [ -f $status_file ]; then + echo "CRITICAL: unable to find status file: $status_file" + exit $nrpe_critical +fi + +if grep -q "^ok$" $status_file; then + echo "OK: all restore tests passed" + exit $nrpe_ok +fi + +if grep -q "^critical$" $status_file; then + echo "CRITICAL: restore test failed, see scriptherder output for details" + exit $nrpe_critical +fi