(redata, jdata, rdb, r_server, config, 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, config, logger):
    ''' This method will be called when a monitor has passed '''
    run = True
    if "true" in jdata['check']['prev_status']:
        run = False

    if "send_true" in redata['data']:
        if redata['data']['send_true'] == "False":
            run = False

    if run:
        result = emailNotify(redata, jdata, "true.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.info(line)
        return None
def true ( redata , jdata , rdb , r_server , config , logger ) : run = True if "true" in jdata [ 'check' ] [ 'prev_status' ] : run = False if "send_true" in redata [ 'data' ] : if redata [ 'data' ] [ 'send_true' ] == "False" : run = False if run : result = emailNotify ( redata , jdata , "true.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 . info ( line ) return None