def run(): """ Main loop. Run this TA forever """ logger.info("Start google_cloud_monitor") metas, tasks = tacommon.get_configs(mconf.GoogleCloudMonitorConfig, "google_cloud_monitor", logger) if not tasks: return loader_mgr = dlm.create_data_loader_mgr(tasks[0]) tacommon.setup_signal_handler(loader_mgr, logger) conf_change_handler = tacommon.get_file_change_handler(loader_mgr, logger) conf_monitor = tacommon.create_conf_monitor( conf_change_handler, [gmc.myta_data_collection_conf]) time.sleep(5) loader_mgr.add_timer(conf_monitor, time.time(), 10) jobs = [gmdl.GoogleCloudMonitorDataLoader(task) for task in tasks] loader_mgr.start(jobs) logger.info("End google_cloud_monitor")
def do_load_data(tear_down_q, task_configs): loaders = [] event_writer = task_configs[0][tac.event_writer] if event_writer is None: event_writer = create_event_writer(task_configs[0], False) for task in task_configs: task[tac.event_writer] = event_writer loaders.append(create_data_loader(task)) loader_mgr = dlm.create_data_loader_mgr(task_configs[0], event_writer) loader_mgr.add_timer(_wait_for_tear_down(tear_down_q, loader_mgr), time.time(), 3) loader_mgr.start(loaders) logger.info("End of load data")
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)
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)
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)
def run(): """ Main loop. Run this TA forever """ logger.info("Start google_cloud_monitor") metas, tasks = tacommon.get_configs( mconf.GoogleCloudMonitorConfig, "google_cloud_monitor", logger) if not tasks: return loader_mgr = dlm.create_data_loader_mgr(tasks[0]) tacommon.setup_signal_handler(loader_mgr, logger) conf_change_handler = tacommon.get_file_change_handler(loader_mgr, logger) conf_monitor = tacommon.create_conf_monitor( conf_change_handler, [gmc.myta_data_collection_conf]) loader_mgr.add_timer(conf_monitor, time.time(), 10) jobs = [gmdl.GoogleCloudMonitorDataLoader(task) for task in tasks] loader_mgr.start(jobs) logger.info("End google_cloud_monitor")