def init_logging(filename): if filename == '-': logs.init_stderr_logging() else: if conf.has_option('main', 'logfile'): filename = conf.get('main', 'logfile') logs.init_generic_logging(logfile=filename, stderr=False)
def main(): """Main execution point""" global _config init_stderr_logging() _config = Configuration() parser = parse_args() if parser.test_api: test_argus_api() elif parser.sync_report: sync_report() elif parser.sync: do_sync() else: if _config.get_sync_on_startup(): do_sync() read_eventengine_stream()
def main(): """Controller""" options, args = parse_options() init_stderr_logging() start_time = datetime.now() _logger.info('Starting migrate at %s', start_time) InterfaceMigrator(args[0]).migrate() SystemMigrator(args[0]).migrate() PpingMigrator(args[0]).migrate() ServicePingMigrator(args[0]).migrate() SensorMigrator(args[0]).migrate() ActiveIpMigrator(args[0]).migrate() _logger.info('Migration done in %s', datetime.now() - start_time)