]>
git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/profile/files/monitoring/check_date
12 if [ -z "$as_user" ]; then
13 last_date
=$($run_command 2>/dev/null | sort | tail -n 1)
15 last_date
=$(sudo -u "$as_user" $run_command 2>/dev/null | sort | tail -n 1)
18 if [ -z "$last_date" ]; then
19 echo "UNKNOWN: Could not read date"
22 last_date
=$(date -d "$last_date" "+%s")
23 LC_ALL
=C last_date
=$(printf "%.*f" 0 $last_date)
24 min_date
=$(date -d "$hours hours ago" "+%s")
25 if [ "$min_date" -lt "$last_date" ]; then
26 echo "OK: Last date $(date -d @$last_date)"
29 echo "CRITICAL: Last date $(date -d @$last_date)"