コード例 #1
0
def export(ctx):
    """
    Exports all raw instance data without any filtering. Useful for pre-caching.
    """
    run_args = ctx.copy()
    suppressoutput = run_args['terse'] or CFG.values.get(
        'suppressconsoleoutput')
    OUTPUT.header('Check Thresholds', suppress=suppressoutput)

    # Load up default monitors and instantiate a task object
    monitortask = MonitorTasks(runargs=run_args)

    # Pull aws information
    try:
        OUTPUT.info('Polling AWS')
        monitortask.poll_instance_data()
    except Exception as monitorclassexception:
        raise monitorclassexception
コード例 #2
0
def test(**kwargs):
    """
    Script testing
    """
    # First get all of our common run args. If not passed in,
    #  they will be updated with global config values (if they line up)
    #  Then we look in the global config for explicit mappings (name differences) that exist

    OUTPUT.info(
        'Merging common test arguments with global config file settings.',
        suppress=True)
    for key, val in RUNARGS.items():
        TESTARGS[key] = kwargs.pop(key, val)
        # Did we get an empty (unpassed) run argument?
        if TESTARGS[key] is None:
            # Do we have the same argument in CFG?
            if key in CFG.values:
                # Does it have a value? Great, lets use it
                if CFG.values[key] is not None:
                    TESTARGS[key] = CFG.values[key]

    suppressoutput = TESTARGS['terse'] or CFG.values.get(
        'suppressconsoleoutput')
    OUTPUT.header('TESTING', suppress=suppressoutput)
コード例 #3
0
ファイル: config.py プロジェクト: zloeber/aws-aware
def config(terse):
    """
    Script configuration
    """
    suppressoutput = terse or CFG.values.get('suppressconsoleoutput')
    OUTPUT.header('SCRIPT CONFIGURATION', suppress=suppressoutput)