check_personal_zephyr_mirrors: Fix too-strict check for being current.

(imported from commit 3ce3c53ed6c52cabd09cd89c6543e74bf2180e33)
This commit is contained in:
Tim Abbott 2013-10-24 11:08:31 -04:00
parent c97278ee8f
commit 996cb40c27
1 changed files with 4 additions and 1 deletions

View File

@ -32,7 +32,10 @@ for results_file_name in os.listdir(RESULTS_DIR):
data = file(results_file).read().strip() data = file(results_file).read().strip()
last_check = os.stat(results_file).st_mtime last_check = os.stat(results_file).st_mtime
time_since_last_check = time.time() - last_check time_since_last_check = time.time() - last_check
if data.split("\n")[-1].strip() == "0" and time_since_last_check < 60: # time_since_last_check threshhold needs to be strictly greater
# than 1 minute, since with cron we expect intervals of at least 1
# minute without any update
if data.split("\n")[-1].strip() == "0" and time_since_last_check < 90:
this_state = "OK" this_state = "OK"
else: else:
this_state = "CRITICAL" this_state = "CRITICAL"