def send_weekly_exit_code(covers_things_since=None): if covers_things_since is None: covers_things_since = Timestamp.get_timestamp_for_string("What's the endpoint of the time range of the last email we sent out?") covers_things_until = datetime.datetime.utcnow() EIGHT_DAYS = datetime.timedelta(days=8) if ((covers_things_until - EIGHT_DAYS) < covers_things_since): print "OK - Last email sent less than 8 days ago" return 0 else: print "CRITICAL - Last email sent more than 8 days ago" return 2
def send_weekly_exit_code(covers_things_since=None): if covers_things_since is None: covers_things_since = Timestamp.get_timestamp_for_string( "What's the endpoint of the time range of the last email we sent out?") covers_things_until = datetime.datetime.utcnow() EIGHT_DAYS = datetime.timedelta(days=8) if ((covers_things_until - EIGHT_DAYS) < covers_things_since): logger.info("OK - Last email sent less than 8 days ago") return 0 else: logger.warn("CRITICAL - Last email sent more than 8 days ago") return 2
def get_time_range_endpoint_of_last_email(): return Timestamp.get_timestamp_for_string(Command.TIMESTAMP_KEY)
def get_time_range_endpoint_of_last_email(): return Timestamp.get_timestamp_for_string(Command.TIMESTAMP_KEY)