#!/bin/sh
#
# Check that we have recent downloads.

# Count the number of log files less than a day old that are over 10M in size
num_files=$(find <%= @local_logs_dir %>/ -name 'gdslog*.gz' -mtime -1 -size +10M | wc -l)

if [ "$num_files" -lt "4" ]; then
  echo "ERROR: Fewer downloaded Akamai logs than expected."
  exit 2
else
  echo "OK"
  exit 0
fi

#!/bin/sh
#
# Check that we have recent downloads.

# Count the number of log files less than a day old that are over 10M in size
num_files=$(find <%= @local_logs_dir %>/ -name 'gdslog*.gz' -mtime -1.2 -size +10M | wc -l)

if [ "$num_files" -lt "4" ]; then
  echo "ERROR: Expected 4 downloaded Akamai logs, only found $num_files."
  exit 2
else
  echo "OK"
  exit 0
fi

Increase time interval for Akamai logs nagios check
Increase time interval for Akamai logs nagios check

Prevent Nagios alert by providing a bit of a buffer around the time
interval.

Also add the actual number of logs found in the error message.
