From c37d6addad3c03356f66c4099349c074e375c742 Mon Sep 17 00:00:00 2001 From: Patrik Holmqvist Date: Fri, 17 Jan 2025 12:38:33 +0100 Subject: [PATCH] Add the file as well... --- .../baas2-check-restore-status | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 global/overlay/etc/puppet/modules/net/files/baas2_restoretest/baas2-check-restore-status 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