(redata, jdata, rdb, r_server, config, logger)
This method will be called when a monitor has false
This method will be called when a monitor has false
This method will be called when a monitor has false
def false(redata, jdata, rdb, r_server, config, logger):
    ''' This method will be called when a monitor has false '''
    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'] or checktime < 900:
        run = False

    if run:
        result = emailNotify(redata, jdata, "false.msg", config, logger)
        if result:
            line = "enotify: Sent %s email notification for monitor %s" % (
                jdata['check']['status'], jdata['cid'])
            logger.info(line)
            return True
        else:
            line = "enotify: False to send %s email notification for monitor %s" % (jdata['check']['status'], jdata['cid'])
            logger.error(line)
            return False
    else:
        line = "enotify: Skipping %s email notification for monitor %s" % (
            jdata['check']['status'], jdata['cid'])
        logger.error(line)
        return None
def false ( redata , jdata , rdb , r_server , config , 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' ] or checktime < 900 : run = False if run : result = emailNotify ( redata , jdata , "false.msg" , config , logger ) if result : line = "enotify: Sent %s email notification for monitor %s" % ( jdata [ 'check' ] [ 'status' ] , jdata [ 'cid' ] ) logger . info ( line ) return True else : line = "enotify: False to send %s email notification for monitor %s" % ( jdata [ 'check' ] [ 'status' ] , jdata [ 'cid' ] ) logger . error ( line ) return False else : line = "enotify: Skipping %s email notification for monitor %s" % ( jdata [ 'check' ] [ 'status' ] , jdata [ 'cid' ] ) logger . error ( line ) return None