def run():
    """
    Main loop. Run this TA forever
    """
    from splunk_ta_aws.modinputs.kinesis.aws_kinesis_conf import AWSKinesisConf, create_conf_monitor
    from splunk_ta_aws.common.aws_concurrent_data_loader import AwsDataLoaderManager

    logger.info("Start Kinesis TA")
    metas, _, tasks = tacommon.get_configs(AWSKinesisConf, "aws_kinesis",
                                           logger)

    if not tasks:
        return

    loader = AwsDataLoaderManager(tasks, 'splunk_ta_aws', 'kinesis')

    conf_change_handler = tacommon.get_file_change_handler(loader, logger)
    conf_monitor = create_conf_monitor(conf_change_handler)
    loader.add_timer(conf_monitor, time.time(), 10)

    orphan_checker = opm.OrphanProcessChecker(loader.stop)
    loader.add_timer(orphan_checker.check_orphan, time.time(), 1)

    # monitor shard changes
    # Disable it for ADDON-9537
    # streams = list(set([t[akc.stream_name] for t in tasks]))
    # shard_checker = akconf.ShardChangesChecker(tasks[0], streams, loader.stop)
    # loader.add_timer(shard_checker, time.time(), 120)

    loader.start()
    logger.info("End Kinesis TA")
def run():
    """
    Main loop. Run this TA forever
    """

    from aws_cloudwatch_conf import AWSCloudWatchConf, create_conf_monitor
    from splunk_ta_aws.common.aws_concurrent_data_loader import AwsDataLoaderManager

    logger.info("Start Cloudwatch TA")
    metas, stanzas, tasks = tacommon.get_configs(AWSCloudWatchConf,
                                                 "aws_cloudwatch", logger)

    if not tasks:
        return

    loader = AwsDataLoaderManager(tasks, 'splunk_ta_aws', 'cloudwatch')

    conf_change_handler = tacommon.get_file_change_handler(loader, logger)
    conf_monitor = create_conf_monitor(conf_change_handler)
    loader.add_timer(conf_monitor, time.time(), 10)

    orphan_checker = opm.OrphanProcessChecker(loader.stop)
    loader.add_timer(orphan_checker.check_orphan, time.time(), 1)

    # mon = acconf.MetricDimensionMonitor(stanzas, loader.tear_down)
    # freq = int(os.environ.get("cloudwatch_mon", 86400))
    # loader.add_timer(mon.check_changes, time.time() + freq, freq)

    loader.start()
    logger.info("End CloudWatch TA")
Example #3
0
def _do_run():
    meta_configs, _, tasks = tacommon.get_configs(aiconf.AWSInspectorConf,
                                                  "aws_inspector", logger)

    if not tasks:
        return

    meta_configs[tac.log_file] = aiconst.inspector_log
    loader_mgr = dlm.create_data_loader_mgr(meta_configs)
    tacommon.setup_signal_handler(loader_mgr, logger)
    conf_change_handler = tacommon.get_file_change_handler(loader_mgr, logger)
    conf_monitor = aiconf.create_conf_monitor(conf_change_handler)
    loader_mgr.add_timer(conf_monitor, time.time(), 10)

    jobs = [aidl.AWSInspectorDataLoader(task) for task in tasks]
    loader_mgr.run(jobs)
def _do_run():
    meta_configs, _, tasks = tacommon.get_configs(
        arc.AWSConfigRuleConf, "aws_config_rule", logger)

    if not tasks:
        return

    meta_configs[tac.log_file] = acc.config_log
    loader_mgr = dlm.create_data_loader_mgr(meta_configs)
    tacommon.setup_signal_handler(loader_mgr, logger)
    conf_change_handler = tacommon.get_file_change_handler(loader_mgr, logger)
    conf_monitor = arc.create_conf_monitor(conf_change_handler)
    loader_mgr.add_timer(conf_monitor, time.time(), 10)

    jobs = [ardl.ConfigRuleDataLoader(task) for task in tasks]
    loader_mgr.run(jobs)
Example #5
0
def _do_run():
    meta_configs, _, tasks = tacommon.get_configs(
        adc.AWSDescribeConf, "aws_description", logger)

    if not tasks:
        logger.info("No data input has been configured, exiting...")
        return

    meta_configs[tac.log_file] = adcon.description_log
    loader_mgr = dlm.create_data_loader_mgr(meta_configs)
    tacommon.setup_signal_handler(loader_mgr, logger)
    conf_change_handler = tacommon.get_file_change_handler(loader_mgr, logger)
    conf_monitor = adc.create_conf_monitor(conf_change_handler)
    loader_mgr.add_timer(conf_monitor, time.time(), 10)

    jobs = [addl.DescriptionDataLoader(task) for task in tasks]
    loader_mgr.run(jobs)
Example #6
0
def _do_run():
    meta_configs, _, tasks = tacommon.get_configs(
        asconfig.AWSS3Conf, "aws_s3", logger)

    if not tasks:
        logger.info("No data input has been configured, exiting...")
        return

    logger.debug("Configuration read from environment.", single_instance=use_single_instance())
    meta_configs[tac.log_file] = asc.s3_log
    loader_mgr = dlm.create_data_loader_mgr(meta_configs)
    tacommon.setup_signal_handler(loader_mgr, logger)
    conf_change_handler = tacommon.get_file_change_handler(loader_mgr, logger)
    conf_monitor = asconfig.create_conf_monitor(conf_change_handler)
    loader_mgr.add_timer(conf_monitor, time.time(), 10)

    jobs = [asdl.S3DataLoader(task) for task in tasks]
    loader_mgr.run(jobs)
def _do_run():
    """
    Main loop. Run this TA for ever
    """

    meta_configs, _, tasks = tacommon.get_configs(acwc.AWSCloudWatchLogsConf,
                                                  "aws_cloudwatch_logs",
                                                  logger)
    if not tasks:
        logger.info("No data input has been configured, exiting...")
        return

    meta_configs[tac.log_file] = aclc.cloudwatch_logs_log
    loader_mgr = dlm.create_data_loader_mgr(meta_configs)
    tacommon.setup_signal_handler(loader_mgr, logger)
    conf_change_handler = tacommon.get_file_change_handler(loader_mgr, logger)
    conf_monitor = acwc.create_conf_monitor(conf_change_handler)
    loader_mgr.add_timer(conf_monitor, time.time(), 10)

    jobs = [acldl.CloudWatchLogsDataLoader(task) for task in tasks]
    loader_mgr.run(jobs)