(redata, jdata, rdb, r_server, logger)
This method will be called when a monitor has passed
This method will be called when a monitor has passed
This method will be called when a monitor has passed
def true(redata, jdata, rdb, r_server, logger):
    ''' This method will be called when a monitor has passed '''
    run = True
    # Check for Trigger
    if redata['trigger'] > jdata['failcount']:
        run = False

    # Check for lastrun
    checktime = time.time() - float(redata['lastrun'])
    if checktime < redata['frequency']:
        run = False

    if run:
        if "failback" in redata['data']:
            if redata['data']['failback'] == "automatic":
                edit(redata, jdata, r_server, logger, failback=True)
        else:
            # Do nothing to prevent unplanned failback
            line = "cloudflare-ip-replace: Monitor is true, nothing to do"
            logger.info(line)
        return True
    else:
        return None
def true ( redata , jdata , rdb , r_server , logger ) : run = True # Check for Trigger if redata [ 'trigger' ] > jdata [ 'failcount' ] : run = False # Check for lastrun checktime = time . time ( ) - float ( redata [ 'lastrun' ] ) if checktime < redata [ 'frequency' ] : run = False if run : if "failback" in redata [ 'data' ] : if redata [ 'data' ] [ 'failback' ] == "automatic" : edit ( redata , jdata , r_server , logger , failback = True ) else : # Do nothing to prevent unplanned failback line = "cloudflare-ip-replace: Monitor is true, nothing to do" logger . info ( line ) return True else : return None