added warning level to the velero timestamp check
This commit is contained in:
parent
82e51abcba
commit
9999bc0cbf
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue