added warning level to the velero timestamp check

This commit is contained in:
Rasmus Thorslund 2025-05-27 16:50:44 +02:00
parent 82e51abcba
commit 9999bc0cbf
No known key found for this signature in database
GPG key ID: 502D33332E9E305D

View file

@ -75,7 +75,8 @@ fi
# Get current timestamp
timestamp=$(echo $LATEST_NAME | awk -F '-' '{print $3}')
crit_days_old=2
crit_days_old=1
warn_days_old=2
# Convert to epoch
timestamp_epoch=$(date -d "${timestamp:0:8} ${timestamp:8:2}:${timestamp:10:2}:${timestamp:12:2}" +%s)
@ -91,6 +92,11 @@ if (( age_days > crit_days_old )); then
echo "CRITICAL: latest backup '$LATEST_NAME' is older than $days_old days ($age_days days old)"
fi
# WARNING if latest is older than 3 days
if (( age_days > warn_days_old )); then
echo "WARNING: latest backup '$LATEST_NAME' is older than $days_old days ($age_days days old)"
fi
# WARNING if any of the last 3 failed
FAIL_LIST=$(jq -r '
.items