exit $STATE_UNKNOWN
else
LC_ALL=C last_date=$(printf "%.*f" 0 $last_date)
+ LC_ALL=C age=$(( $(date "+%s") - $last_date))
+ max_age=$(( $hours * 60 * 60 ))
min_date=$(date -d "$hours hours ago" "+%s")
if [ "$min_date" -lt "$last_date" ]; then
- echo "OK: Last file $(date -d @$last_date)"
+ echo "OK: Last file $(date -d @$last_date) | age=${age}s;;$max_age;;"
exit $STATE_OK
else
- echo "CRITICAL: Last file $(date -d @$last_date)"
+ echo "CRITICAL: Last file $(date -d @$last_date) | age=${age}s;;$max_age;;"
exit $STATE_CRITICAL
fi
fi