コード例 #1
0
ファイル: filter.py プロジェクト: CERT-Polska/n6
def main():
    with logging_configured():
        d = Filter()
        try:
            d.run()
        except KeyboardInterrupt:
            d.stop()
コード例 #2
0
ファイル: comparator.py プロジェクト: CERT-Polska/n6
def main():
    with logging_configured():
        c = Comparator()
        try:
            c.run()
        except KeyboardInterrupt:
            c.stop()
コード例 #3
0
def main():
    with logging_configured():
        enricher = Enricher()
        try:
            enricher.run()
        except KeyboardInterrupt:
            enricher.stop()
コード例 #4
0
ファイル: recorder.py プロジェクト: scottwedge/n6
def main():
    with logging_configured():
        if os.environ.get('n6integration_test'):
            # for debugging only
            LOGGER.setLevel(logging.DEBUG)
            LOGGER.addHandler(logging.StreamHandler(stream=sys.__stdout__))
        d = Recorder()
        try:
            d.run()
        except KeyboardInterrupt:
            d.stop()
コード例 #5
0
ファイル: aggregator.py プロジェクト: lazerhawk/n6
def main():
    with logging_configured():
        if 'n6integration_test' in os.environ:
            # for debugging only
            import logging
            import sys
            LOGGER.setLevel(logging.DEBUG)
            LOGGER.addHandler(logging.StreamHandler(stream=sys.__stdout__))
        a = Aggregator()
        try:
            a.run()
        except KeyboardInterrupt:
            a.stop()
コード例 #6
0
ファイル: app.py プロジェクト: tensts/n6
def get_app():
    """
    Configure an SQL engine and return Flask-Admin WSGI application
    object.

    Returns:
        A flask.app.Flask instance.
    """
    with logging_configured():
        monkey_patch_flask_admin()
        engine = SQLAuthDBConfigMixin().engine
        admin_panel = AdminPanel(engine)
        return admin_panel.app
コード例 #7
0
def main():
    parser = Recorder.get_arg_parser()
    args = Recorder.parse_only_n6_args(parser)
    if args.n6recorder_non_blacklist:
        monkey_patch_non_bl_recorder()
    elif args.n6recorder_blacklist is not None:
        monkey_patch_bl_recorder(args.n6recorder_blacklist)
    with logging_configured():
        if os.environ.get('n6integration_test'):
            # for debugging only
            LOGGER.setLevel(logging.DEBUG)
            LOGGER.addHandler(logging.StreamHandler(stream=sys.__stdout__))
        d = Recorder()
        try:
            d.run()
        except KeyboardInterrupt:
            d.stop()
コード例 #8
0
def main():
    with logging_configured():
        t = DBarchiver()
        try:
            t.run()
        except KeyboardInterrupt:
            LOGGER.debug('SIGINT. waiting for ...')
            t.stop()
        except socket.timeout as exc:
            # at the moment need to capture sys.exit tool for monitoring
            LOGGER.critical('socket.timeout: %r', exc)
            print >> sys.stderr, exc
            sys.exit(1)
        except socket.error as exc:
            # at the moment need to capture sys.exit tool for monitoring
            LOGGER.critical('socket.error: %r', exc)
            print >> sys.stderr, exc
            sys.exit(1)
コード例 #9
0
ファイル: generic.py プロジェクト: scottwedge/n6
 def parser_main():
     with logging_configured():
         init_kwargs = parser_class.get_script_init_kwargs()
         parser = parser_class(**init_kwargs)
         parser.run_handling()
コード例 #10
0
ファイル: generic.py プロジェクト: scottwedge/n6
 def parser_main():
     with logging_configured():
         init_kwargs = collector_class.get_script_init_kwargs()
         collector = collector_class(**init_kwargs)
         collector.run_handling()
コード例 #11
0
ファイル: base.py プロジェクト: CERT-Polska/n6
 def run_script(cls):
     with logging_configured():
         init_kwargs = cls.get_script_init_kwargs()
         parser = cls(**init_kwargs)
         parser.run_handling()
コード例 #12
0
ファイル: wrapper.py プロジェクト: CERT-Polska/n6
 def _do_run(bot_class):
     with logging_configured():
         bot_instance = bot_class()
         bot_instance.run()
コード例 #13
0
ファイル: intelmq_adapter.py プロジェクト: CERT-Polska/n6
def _run_adapter(adapter_class: Type[IntelMQAdapter]) -> None:
    with logging_configured():
        adapter_class().run()
コード例 #14
0
ファイル: base.py プロジェクト: CERT-Polska/n6
 def run_script(cls):
     with logging_configured():
         init_kwargs = cls.get_script_init_kwargs()
         collector = cls(**init_kwargs)  # noqa
         collector.run_handling()