Exemplo n.º 1
0
  def __init__(self, config=None):
    print("Blueflood Finder v25")
    if config is not None:
      bf_config = config.get('blueflood', {})
      urls = bf_config.get('urls', bf_config.get('url', '').strip('/'))
      tenant = bf_config.get('tenant', None)
      authentication_module =  bf_config.get('authentication_module', None)
      authentication_class =  bf_config.get('authentication_class', None)
      enable_submetrics = bf_config.get('enable_submetrics', False)
      submetric_aliases = bf_config.get('submetric_aliases', {})
    else:
      from django.conf import settings
      urls = getattr(settings, 'BF_QUERY')
      tenant = getattr(settings, 'BF_TENANT')
      authentication_module = getattr(settings, 'BF_AUTHENTICATION_MODULE', None)
      authentication_class = getattr(settings, 'BF_AUTHENTICATION_CLASS', None)
      enable_submetrics = getattr(settings, 'BF_ENABLE_SUBMETRICS', False)
      submetric_aliases = getattr(settings, 'BF_SUBMETRIC_ALIASES', {})

    if authentication_module:
      module = __import__(authentication_module)
      class_ = getattr(module, authentication_class)
      bfauth = class_(config)
      auth.set_auth(bfauth)

    self.tenant = tenant
    self.bf_query_endpoint = urls[0]
    self.enable_submetrics = enable_submetrics
    self.submetric_aliases = submetric_aliases
    self.client = BluefloodClient(self.bf_query_endpoint, self.tenant, 
                                  self.enable_submetrics, self.submetric_aliases)
    print("BF finder submetrics enabled: ", enable_submetrics)
Exemplo n.º 2
0
  def __init__(self, config=None):
    authentication_module = None
    if config is not None:
      if 'urls' in config['blueflood']:
        urls = config['blueflood']['urls']
      else:
        urls = [config['blueflood']['url'].strip('/')]
      tenant = config['blueflood']['tenant']
      if 'authentication_module' in config['blueflood']:
        authentication_module = config['blueflood']['authentication_module']
        authentication_class = config['blueflood']['authentication_class']
    else:
      from django.conf import settings
      urls = getattr(settings, 'BF_QUERY')
      tenant = getattr(settings, 'BF_TENANT')
      authentication_module = getattr(settings, 'BF_AUTHENTICATION_MODULE', None)
      authentication_class = getattr(settings, 'BF_AUTHENTICATION_CLASS', None)

    if authentication_module:
      module = __import__(authentication_module)
      class_ = getattr(module, authentication_class)
      bfauth = class_(config)
      auth.set_auth(bfauth)

    self.tenant = tenant
    self.bf_query_endpoint = urls[0]
Exemplo n.º 3
0
    def __init__(self, config=None):
        authentication_module = None
        if config is not None:
            if 'urls' in config['blueflood']:
                urls = config['blueflood']['urls']
            else:
                urls = [config['blueflood']['url'].strip('/')]
            tenant = config['blueflood']['tenant']
            if 'authentication_module' in config['blueflood']:
                authentication_module = config['blueflood'][
                    'authentication_module']
                authentication_class = config['blueflood'][
                    'authentication_class']
        else:
            from django.conf import settings
            urls = getattr(settings, 'BF_QUERY')
            tenant = getattr(settings, 'BF_TENANT')
            authentication_module = getattr(settings,
                                            'BF_AUTHENTICATION_MODULE', None)
            authentication_class = getattr(settings, 'BF_AUTHENTICATION_CLASS',
                                           None)

        if authentication_module:
            module = __import__(authentication_module)
            class_ = getattr(module, authentication_class)
            bfauth = class_(config)
            auth.set_auth(bfauth)

        self.tenant = tenant
        self.bf_query_endpoint = urls[0]
Exemplo n.º 4
0
    def __init__(self, config=None):
        print("Blueflood Finder v31")
        threading.Thread.__init__(self)
        if os.path.isfile("/root/pdb-flag"):
            import remote_pdb
            remote_pdb.RemotePdb('127.0.0.1', 4444).set_trace()
        if config is not None:
            bf_config = config.get('blueflood', {})
            urls = bf_config.get('urls', bf_config.get('url', '').strip('/'))
            tenant = bf_config.get('tenant', None)
            authentication_module = bf_config.get('authentication_module',
                                                  None)
            authentication_class = bf_config.get('authentication_class', None)
            enable_submetrics = bf_config.get('enable_submetrics', False)
            submetric_aliases = bf_config.get('submetric_aliases', {})
        else:
            from django.conf import settings
            urls = getattr(settings, 'BF_QUERY')
            tenant = getattr(settings, 'BF_TENANT')
            authentication_module = getattr(settings,
                                            'BF_AUTHENTICATION_MODULE', None)
            authentication_class = getattr(settings, 'BF_AUTHENTICATION_CLASS',
                                           None)
            enable_submetrics = getattr(settings, 'BF_ENABLE_SUBMETRICS',
                                        False)
            submetric_aliases = getattr(settings, 'BF_SUBMETRIC_ALIASES', {})

        if authentication_module:
            module = __import__(authentication_module)
            class_ = getattr(module, authentication_class)
            bfauth = class_(config)
            auth.set_auth(bfauth)

        self.exit_flag = 0
        self.metrics_q = Queue.Queue(1)
        self.data_q = Queue.Queue(1)

        self.tenant = tenant
        self.bf_query_endpoint = urls[0]
        self.enable_submetrics = enable_submetrics
        self.submetric_aliases = submetric_aliases
        self.client = BluefloodClient(self.bf_query_endpoint, self.tenant,
                                      self.enable_submetrics,
                                      self.submetric_aliases)
        self.daemon = True
        self.start()
        print("BF finder submetrics enabled: ", enable_submetrics)
Exemplo n.º 5
0
    def __init__(self, config=None):
        print ("Blueflood Finder v31")
        threading.Thread.__init__(self)
        if os.path.isfile("/root/pdb-flag"):
            import remote_pdb

            remote_pdb.RemotePdb("127.0.0.1", 4444).set_trace()
        if config is not None:
            bf_config = config.get("blueflood", {})
            urls = bf_config.get("urls", bf_config.get("url", "").strip("/"))
            tenant = bf_config.get("tenant", None)
            authentication_module = bf_config.get("authentication_module", None)
            authentication_class = bf_config.get("authentication_class", None)
            enable_submetrics = bf_config.get("enable_submetrics", False)
            submetric_aliases = bf_config.get("submetric_aliases", {})
        else:
            from django.conf import settings

            urls = getattr(settings, "BF_QUERY")
            tenant = getattr(settings, "BF_TENANT")
            authentication_module = getattr(settings, "BF_AUTHENTICATION_MODULE", None)
            authentication_class = getattr(settings, "BF_AUTHENTICATION_CLASS", None)
            enable_submetrics = getattr(settings, "BF_ENABLE_SUBMETRICS", False)
            submetric_aliases = getattr(settings, "BF_SUBMETRIC_ALIASES", {})

        if authentication_module:
            module = __import__(authentication_module)
            class_ = getattr(module, authentication_class)
            bfauth = class_(config)
            auth.set_auth(bfauth)

        self.exit_flag = 0
        self.metrics_q = Queue.Queue(1)
        self.data_q = Queue.Queue(1)

        self.tenant = tenant
        self.bf_query_endpoint = urls[0]
        self.enable_submetrics = enable_submetrics
        self.submetric_aliases = submetric_aliases
        self.client = BluefloodClient(
            self.bf_query_endpoint, self.tenant, self.enable_submetrics, self.submetric_aliases
        )
        self.daemon = True
        self.start()
        print ("BF finder submetrics enabled: ", enable_submetrics)
Exemplo n.º 6
0
  def __init__(self, config=None):
    logger.debug("Blueflood Finder v31")
    threading.Thread.__init__(self)
    if os.path.isfile("/root/pdb-flag"):
      import remote_pdb
      remote_pdb.RemotePdb('127.0.0.1', 4444).set_trace()
    if config is not None:
      bf_config = config.get('blueflood', {})
      urls = bf_config.get('urls', bf_config.get('url', '').strip('/'))
      tenant = bf_config.get('tenant', None)
      authentication_module =  bf_config.get('authentication_module', None)
      authentication_class =  bf_config.get('authentication_class', None)
      enable_submetrics = bf_config.get('enable_submetrics', False)
      submetric_aliases = bf_config.get('submetric_aliases', {})
    else:
      from django.conf import settings
      urls = getattr(settings, 'BF_QUERY')
      tenant = getattr(settings, 'BF_TENANT')
      authentication_module = getattr(settings, 'BF_AUTHENTICATION_MODULE', None)
      authentication_class = getattr(settings, 'BF_AUTHENTICATION_CLASS', None)
      enable_submetrics = getattr(settings, 'BF_ENABLE_SUBMETRICS', False)
      submetric_aliases = getattr(settings, 'BF_SUBMETRIC_ALIASES', {})

    if authentication_module:
      module = __import__(authentication_module)
      class_ = getattr(module, authentication_class)
      bfauth = class_(config)
      auth.set_auth(bfauth)

    self.exit_flag = 0
    self.metrics_q = Queue.Queue(1)
    self.data_q = Queue.Queue(1)

    self.tenant = tenant
    self.bf_query_endpoint = urls[0]
    self.enable_submetrics = enable_submetrics
    self.submetric_aliases = submetric_aliases
    self.client = BluefloodClient(self.bf_query_endpoint, self.tenant,
                                  self.enable_submetrics, self.submetric_aliases)
    self.daemon = True
    self.start()
    logger.debug("BF finder submetrics enabled: %s", enable_submetrics)
Exemplo n.º 7
0
    def __init__(self, config=None):
        print("Blueflood Finder v25")
        if config is not None:
            bf_config = config.get('blueflood', {})
            urls = bf_config.get('urls', bf_config.get('url', '').strip('/'))
            tenant = bf_config.get('tenant', None)
            authentication_module = bf_config.get('authentication_module',
                                                  None)
            authentication_class = bf_config.get('authentication_class', None)
            enable_submetrics = bf_config.get('enable_submetrics', False)
            submetric_aliases = bf_config.get('submetric_aliases', {})
        else:
            from django.conf import settings
            urls = getattr(settings, 'BF_QUERY')
            tenant = getattr(settings, 'BF_TENANT')
            authentication_module = getattr(settings,
                                            'BF_AUTHENTICATION_MODULE', None)
            authentication_class = getattr(settings, 'BF_AUTHENTICATION_CLASS',
                                           None)
            enable_submetrics = getattr(settings, 'BF_ENABLE_SUBMETRICS',
                                        False)
            submetric_aliases = getattr(settings, 'BF_SUBMETRIC_ALIASES', {})

        if authentication_module:
            module = __import__(authentication_module)
            class_ = getattr(module, authentication_class)
            bfauth = class_(config)
            auth.set_auth(bfauth)

        self.tenant = tenant
        self.bf_query_endpoint = urls[0]
        self.enable_submetrics = enable_submetrics
        self.submetric_aliases = submetric_aliases
        self.client = BluefloodClient(self.bf_query_endpoint, self.tenant,
                                      self.enable_submetrics,
                                      self.submetric_aliases)
        print("BF finder submetrics enabled: ", enable_submetrics)