Add the file as well...

This commit is contained in:
Patrik Holmqvist 2025-01-17 12:38:33 +01:00
parent 2d5c316846
commit c37d6addad
Signed by: pahol
GPG key ID: 5D5B0D4E93F77273

View file

@ -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