コード例 #1
0
def main(itm_code):
    try:
        try:
            (check_value, detail_msg) = check()
        except Exception, e:
            logger.exception(e)
            exception_msg = "%s" % e
            api_helper.registerException(itm_code, exception_msg)
        else:
コード例 #2
0
def main(itm_code):
    try:
        try:
            (check_value, detail_msg, notification_msg) = check()
        except Exception, e:
            logger.exception(e)
            exception_msg = "%s" % e
            api_helper.registerException(itm_code, exception_msg)
        else:
コード例 #3
0
def main(itm_code):
    try:
        try:
            (status, detail_msg, notification_msg) = check()
        except Exception, e:
            logger.exception(e)
            exception_msg = "%s" % e
            api_helper.registerException(itm_code, exception_msg)
        else:
コード例 #4
0
def main(itm_code):
    try:
        try:
            global state_updater
            (status, detail_msg) = check()
        except Exception, e:
            logger.exception(e)
            exception_msg = "%s" % e
            api_helper.registerException(itm_code, exception_msg)
        else:
コード例 #5
0
def main(itm_code):
    try:
        try:
            global state_updater
            (status, detail_msg) = check()
        except Exception, e:
            logger.exception(e)
            exception_msg = "%s" % e
            api_helper.registerException(itm_code, exception_msg)
        else:
コード例 #6
0
        try:
            global state_updater
            (status, detail_msg) = check()
        except Exception, e:
            logger.exception(e)
            exception_msg = "%s" % e
            api_helper.registerException(itm_code, exception_msg)
        else:
            # Log capture is aborted, mark as warning
            status = const.CHECK_STATUS_WARN
            detail_msg = """On server %s, it is aborted to capture the log file (%s,%s).
              Then it will cause false alarm when next check.""" % (
                app_server, log_folder, file_pattern)
            logger.info("Check status: %s" % status)
            logger.info("Check detail message: %s" % detail_msg)
            api_helper.registerException(itm_code, detail_msg)

    except Exception, e:
        logger.exception(e)


if __name__ == "__main__":
    itm_code = "DETECT_THREADSTUCK_IN_LOG_FILE"  # configure this check item in your database before run
    logger.info("=================================")
    logger.info("===check item: %s" % itm_code)
    logger.info("=================================")

    main(itm_code)

    logger.info("===End to check: %s" % itm_code)
コード例 #7
0
    try:
        try:
            global state_updater
            (status, detail_msg) = check()
        except Exception, e:
            logger.exception(e)
            exception_msg = "%s" % e
            api_helper.registerException(itm_code, exception_msg)
        else:
            # Log capture is aborted, mark as warning
            status = const.CHECK_STATUS_WARN
            detail_msg = """On server %s, it is aborted to capture the log file (%s,%s).
              Then it will cause false alarm when next check.""" % (app_server, log_folder, file_pattern)
            logger.info("Check status: %s" % status)
            logger.info("Check detail message: %s" % detail_msg)
            api_helper.registerException(itm_code, detail_msg)

    except Exception, e:
        logger.exception(e)


if __name__ == "__main__":
    itm_code = "DETECT_THREADSTUCK_IN_LOG_FILE"  # configure this check item in your database before run
    logger.info("=================================")
    logger.info("===check item: %s" % itm_code)
    logger.info("=================================")

    main(itm_code)

    logger.info("===End to check: %s" % itm_code)